<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">-- Copyright 2016 TensorFlow authors.</span><span>
</span><span id="line-2"></span><span class="hs-comment">--</span><span>
</span><span id="line-3"></span><span class="hs-comment">-- Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span><span>
</span><span id="line-4"></span><span class="hs-comment">-- you may not use this file except in compliance with the License.</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- You may obtain a copy of the License at</span><span>
</span><span id="line-6"></span><span class="hs-comment">--</span><span>
</span><span id="line-7"></span><span class="hs-comment">--     http://www.apache.org/licenses/LICENSE-2.0</span><span>
</span><span id="line-8"></span><span class="hs-comment">--</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Unless required by applicable law or agreed to in writing, software</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- See the License for the specific language governing permissions and</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- limitations under the License.</span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span class="hs-pragma">{-# LANGUAGE GeneralizedNewtypeDeriving #-}</span><span>
</span><span id="line-16"></span><span class="hs-pragma">{-# LANGUAGE FlexibleInstances #-}</span><span>
</span><span id="line-17"></span><span class="hs-pragma">{-# LANGUAGE LambdaCase #-}</span><span>
</span><span id="line-18"></span><span class="hs-pragma">{-# LANGUAGE FunctionalDependencies #-}</span><span>
</span><span id="line-19"></span><span class="hs-pragma">{-# LANGUAGE MultiParamTypeClasses #-}</span><span>
</span><span id="line-20"></span><span class="hs-pragma">{-# LANGUAGE OverloadedStrings #-}</span><span>
</span><span id="line-21"></span><span class="hs-pragma">{-# LANGUAGE Rank2Types #-}</span><span>
</span><span id="line-22"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-23"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">TensorFlow.Build</span><span>
</span><span id="line-24"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="hs-comment">-- * Graph node types</span></span><span>
</span><span id="line-25"></span><span>      </span><span class="annot"><a href="TensorFlow.Output.html#ControlNode"><span class="hs-identifier">ControlNode</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-26"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#Unique"><span class="hs-identifier">Unique</span></a></span><span>
</span><span id="line-27"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Ops</span></span><span>
</span><span id="line-28"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#explicitName"><span class="hs-identifier">explicitName</span></a></span><span>
</span><span id="line-29"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#implicitName"><span class="hs-identifier">implicitName</span></a></span><span>
</span><span id="line-30"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#opDef"><span class="hs-identifier">opDef</span></a></span><span>
</span><span id="line-31"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#opDefWithName"><span class="hs-identifier">opDefWithName</span></a></span><span>
</span><span id="line-32"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Output.html#opName"><span class="hs-identifier">opName</span></a></span><span>
</span><span id="line-33"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Output.html#opType"><span class="hs-identifier">opType</span></a></span><span>
</span><span id="line-34"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Output.html#opAttr"><span class="hs-identifier">opAttr</span></a></span><span>
</span><span id="line-35"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Output.html#opInputs"><span class="hs-identifier">opInputs</span></a></span><span>
</span><span id="line-36"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Output.html#opControlInputs"><span class="hs-identifier">opControlInputs</span></a></span><span>
</span><span id="line-37"></span><span>    </span><span class="annot"><span class="hs-comment">-- * The Build monad</span></span><span>
</span><span id="line-38"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#GraphState"><span class="hs-identifier">GraphState</span></a></span><span>
</span><span id="line-39"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#renderedNodeDefs"><span class="hs-identifier">renderedNodeDefs</span></a></span><span>
</span><span id="line-40"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#BuildT"><span class="hs-identifier">BuildT</span></a></span><span>
</span><span id="line-41"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#Build"><span class="hs-identifier">Build</span></a></span><span>
</span><span id="line-42"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#MonadBuild"><span class="hs-identifier">MonadBuild</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-43"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#addInitializer"><span class="hs-identifier">addInitializer</span></a></span><span>
</span><span id="line-44"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#hoistBuildT"><span class="hs-identifier">hoistBuildT</span></a></span><span>
</span><span id="line-45"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#evalBuildT"><span class="hs-identifier">evalBuildT</span></a></span><span>
</span><span id="line-46"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#runBuildT"><span class="hs-identifier">runBuildT</span></a></span><span>
</span><span id="line-47"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#asGraphDef"><span class="hs-identifier">asGraphDef</span></a></span><span>
</span><span id="line-48"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#addGraphDef"><span class="hs-identifier">addGraphDef</span></a></span><span>
</span><span id="line-49"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#flushInitializers"><span class="hs-identifier">flushInitializers</span></a></span><span>
</span><span id="line-50"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#flushNodeBuffer"><span class="hs-identifier">flushNodeBuffer</span></a></span><span>
</span><span id="line-51"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#summaries"><span class="hs-identifier">summaries</span></a></span><span>
</span><span id="line-52"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Creating and looking up Ops</span></span><span>
</span><span id="line-53"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#getOrAddOp"><span class="hs-identifier">getOrAddOp</span></a></span><span>
</span><span id="line-54"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#addNewOp"><span class="hs-identifier">addNewOp</span></a></span><span>
</span><span id="line-55"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#encodeOutput"><span class="hs-identifier">encodeOutput</span></a></span><span>
</span><span id="line-56"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#lookupNode"><span class="hs-identifier">lookupNode</span></a></span><span>
</span><span id="line-57"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Modifying all nodes in a Build action</span></span><span>
</span><span id="line-58"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#withStateLens"><span class="hs-identifier">withStateLens</span></a></span><span>
</span><span id="line-59"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#withDevice"><span class="hs-identifier">withDevice</span></a></span><span>
</span><span id="line-60"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#withNameScope"><span class="hs-identifier">withNameScope</span></a></span><span>
</span><span id="line-61"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#withNodeDependencies"><span class="hs-identifier">withNodeDependencies</span></a></span><span>
</span><span id="line-62"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Data.ProtoLens.Message</span></span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">defMessage</span></span><span class="hs-special">)</span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Control.Monad.Catch</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">MonadThrow</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier">MonadCatch</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier">MonadMask</span></span><span class="hs-special">)</span><span>
</span><span id="line-66"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Control.Monad.Fix</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">MonadFix</span></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Control.Monad.IO.Class</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">MonadIO</span></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-68"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Control.Monad.Trans.Class</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">MonadTrans</span></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-69"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Control.Monad.Trans.State.Strict</span></span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">StateT</span></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier">mapStateT</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier">evalStateT</span></span><span class="hs-special">)</span><span>
</span><span id="line-70"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Data.Functor.Identity</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">Identity</span></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><span class="hs-identifier">Data.Map.Strict</span></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Map</span></span><span>
</span><span id="line-72"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><span class="hs-identifier">Data.Set</span></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Set</span></span><span>
</span><span id="line-73"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Data.Set</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">Set</span></span><span class="hs-special">)</span><span>
</span><span id="line-74"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Data.String</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">IsString</span></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-75"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Data.Text</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">Text</span></span><span class="hs-special">)</span><span>
</span><span id="line-76"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><span class="hs-identifier">Data.Text</span></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Text</span></span><span>
</span><span id="line-77"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Lens.Family2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">Lens'</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-operator">(.~)</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-operator">(^.)</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-operator">(&amp;)</span></span><span class="hs-special">)</span><span>
</span><span id="line-78"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Lens.Family2.State.Strict</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">MonadState</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier">use</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier">uses</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-operator">(.=)</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-operator">(&lt;&gt;=)</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-operator">(%=)</span></span><span class="hs-special">)</span><span>
</span><span id="line-79"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Lens.Family2.Unchecked</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">lens</span></span><span class="hs-special">)</span><span>
</span><span id="line-80"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Proto.Tensorflow.Core.Framework.Graph</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">GraphDef</span></span><span class="hs-special">)</span><span>
</span><span id="line-81"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Proto.Tensorflow.Core.Framework.Graph_Fields</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">node</span></span><span class="hs-special">)</span><span>
</span><span id="line-82"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Proto.Tensorflow.Core.Framework.NodeDef</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">NodeDef</span></span><span class="hs-special">)</span><span>
</span><span id="line-83"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-identifier">Proto.Tensorflow.Core.Framework.NodeDef_Fields</span></span><span>
</span><span id="line-84"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="hs-identifier">attr</span></span><span>
</span><span id="line-85"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier">input</span></span><span>
</span><span id="line-86"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier">device</span></span><span>
</span><span id="line-87"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier">name</span></span><span>
</span><span id="line-88"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier">op</span></span><span>
</span><span id="line-89"></span><span>    </span><span class="hs-special">)</span><span>
</span><span id="line-90"></span><span>
</span><span id="line-91"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="TensorFlow.Output.html"><span class="hs-identifier">TensorFlow.Output</span></a></span><span>
</span><span id="line-92"></span><span>
</span><span id="line-93"></span><span class="hs-keyword">newtype</span><span> </span><span id="Unique"><span class="annot"><a href="TensorFlow.Build.html#Unique"><span class="hs-identifier hs-var">Unique</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Unique"><span class="annot"><a href="TensorFlow.Build.html#Unique"><span class="hs-identifier hs-var">Unique</span></a></span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-94"></span><span>    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679165590"><span id="local-6989586621679165592"><span class="annot"><span class="annottext">Unique -&gt; Unique -&gt; Bool
(Unique -&gt; Unique -&gt; Bool)
-&gt; (Unique -&gt; Unique -&gt; Bool) -&gt; Eq Unique
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: Unique -&gt; Unique -&gt; Bool
$c/= :: Unique -&gt; Unique -&gt; Bool
== :: Unique -&gt; Unique -&gt; Bool
$c== :: Unique -&gt; Unique -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679165574"><span id="local-6989586621679165576"><span id="local-6989586621679165578"><span id="local-6989586621679165580"><span id="local-6989586621679165582"><span id="local-6989586621679165584"><span id="local-6989586621679165586"><span class="annot"><span class="annottext">Eq Unique
Eq Unique =&gt;
(Unique -&gt; Unique -&gt; Ordering)
-&gt; (Unique -&gt; Unique -&gt; Bool)
-&gt; (Unique -&gt; Unique -&gt; Bool)
-&gt; (Unique -&gt; Unique -&gt; Bool)
-&gt; (Unique -&gt; Unique -&gt; Bool)
-&gt; (Unique -&gt; Unique -&gt; Unique)
-&gt; (Unique -&gt; Unique -&gt; Unique)
-&gt; Ord Unique
Unique -&gt; Unique -&gt; Bool
Unique -&gt; Unique -&gt; Ordering
Unique -&gt; Unique -&gt; Unique
forall a.
Eq a =&gt;
(a -&gt; a -&gt; Ordering)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; a)
-&gt; (a -&gt; a -&gt; a)
-&gt; Ord a
min :: Unique -&gt; Unique -&gt; Unique
$cmin :: Unique -&gt; Unique -&gt; Unique
max :: Unique -&gt; Unique -&gt; Unique
$cmax :: Unique -&gt; Unique -&gt; Unique
&gt;= :: Unique -&gt; Unique -&gt; Bool
$c&gt;= :: Unique -&gt; Unique -&gt; Bool
&gt; :: Unique -&gt; Unique -&gt; Bool
$c&gt; :: Unique -&gt; Unique -&gt; Bool
&lt;= :: Unique -&gt; Unique -&gt; Bool
$c&lt;= :: Unique -&gt; Unique -&gt; Bool
&lt; :: Unique -&gt; Unique -&gt; Bool
$c&lt; :: Unique -&gt; Unique -&gt; Bool
compare :: Unique -&gt; Unique -&gt; Ordering
$ccompare :: Unique -&gt; Unique -&gt; Ordering
$cp1Ord :: Eq Unique
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Ord</span></span></span></span></span></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679165557"><span id="local-6989586621679165559"><span id="local-6989586621679165561"><span id="local-6989586621679165563"><span id="local-6989586621679165565"><span id="local-6989586621679165567"><span id="local-6989586621679165569"><span id="local-6989586621679165571"><span class="annot"><span class="annottext">Int -&gt; Unique
Unique -&gt; Int
Unique -&gt; [Unique]
Unique -&gt; Unique
Unique -&gt; Unique -&gt; [Unique]
Unique -&gt; Unique -&gt; Unique -&gt; [Unique]
(Unique -&gt; Unique)
-&gt; (Unique -&gt; Unique)
-&gt; (Int -&gt; Unique)
-&gt; (Unique -&gt; Int)
-&gt; (Unique -&gt; [Unique])
-&gt; (Unique -&gt; Unique -&gt; [Unique])
-&gt; (Unique -&gt; Unique -&gt; [Unique])
-&gt; (Unique -&gt; Unique -&gt; Unique -&gt; [Unique])
-&gt; Enum Unique
forall a.
(a -&gt; a)
-&gt; (a -&gt; a)
-&gt; (Int -&gt; a)
-&gt; (a -&gt; Int)
-&gt; (a -&gt; [a])
-&gt; (a -&gt; a -&gt; [a])
-&gt; (a -&gt; a -&gt; [a])
-&gt; (a -&gt; a -&gt; a -&gt; [a])
-&gt; Enum a
enumFromThenTo :: Unique -&gt; Unique -&gt; Unique -&gt; [Unique]
$cenumFromThenTo :: Unique -&gt; Unique -&gt; Unique -&gt; [Unique]
enumFromTo :: Unique -&gt; Unique -&gt; [Unique]
$cenumFromTo :: Unique -&gt; Unique -&gt; [Unique]
enumFromThen :: Unique -&gt; Unique -&gt; [Unique]
$cenumFromThen :: Unique -&gt; Unique -&gt; [Unique]
enumFrom :: Unique -&gt; [Unique]
$cenumFrom :: Unique -&gt; [Unique]
fromEnum :: Unique -&gt; Int
$cfromEnum :: Unique -&gt; Int
toEnum :: Int -&gt; Unique
$ctoEnum :: Int -&gt; Unique
pred :: Unique -&gt; Unique
$cpred :: Unique -&gt; Unique
succ :: Unique -&gt; Unique
$csucc :: Unique -&gt; Unique
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Enum</span></span></span></span></span></span></span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span class="hs-comment">--------------</span><span>
</span><span id="line-97"></span><span>
</span><span id="line-98"></span><span class="annot"><a href="TensorFlow.Build.html#implicitName"><span class="hs-identifier hs-type">implicitName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Output.html#PendingNodeName"><span class="hs-identifier hs-type">PendingNodeName</span></a></span><span>
</span><span id="line-99"></span><span id="implicitName"><span class="annot"><span class="annottext">implicitName :: PendingNodeName
</span><a href="TensorFlow.Build.html#implicitName"><span class="hs-identifier hs-var hs-var">implicitName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PendingNodeName
</span><a href="TensorFlow.Output.html#ImplicitName"><span class="hs-identifier hs-var">ImplicitName</span></a></span><span>
</span><span id="line-100"></span><span>
</span><span id="line-101"></span><span class="annot"><a href="TensorFlow.Build.html#explicitName"><span class="hs-identifier hs-type">explicitName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Text</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Output.html#PendingNodeName"><span class="hs-identifier hs-type">PendingNodeName</span></a></span><span>
</span><span id="line-102"></span><span id="explicitName"><span class="annot"><span class="annottext">explicitName :: Text -&gt; PendingNodeName
</span><a href="TensorFlow.Build.html#explicitName"><span class="hs-identifier hs-var hs-var">explicitName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; PendingNodeName
</span><a href="TensorFlow.Output.html#ExplicitName"><span class="hs-identifier hs-var">ExplicitName</span></a></span><span>
</span><span id="line-103"></span><span>
</span><span id="line-104"></span><span class="hs-keyword">newtype</span><span> </span><span id="Scope"><span class="annot"><a href="TensorFlow.Build.html#Scope"><span class="hs-identifier hs-var">Scope</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Scope"><span class="annot"><a href="TensorFlow.Build.html#Scope"><span class="hs-identifier hs-var">Scope</span></a></span></span><span> </span><span class="hs-special">{</span><span id="unScope"><span class="annot"><span class="annottext">Scope -&gt; Text
</span><a href="TensorFlow.Build.html#unScope"><span class="hs-identifier hs-var hs-var">unScope</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Text</span></span><span class="hs-special">}</span><span>
</span><span id="line-105"></span><span>    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679165548"><span id="local-6989586621679165550"><span class="annot"><span class="annottext">Scope -&gt; Scope -&gt; Bool
(Scope -&gt; Scope -&gt; Bool) -&gt; (Scope -&gt; Scope -&gt; Bool) -&gt; Eq Scope
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: Scope -&gt; Scope -&gt; Bool
$c/= :: Scope -&gt; Scope -&gt; Bool
== :: Scope -&gt; Scope -&gt; Bool
$c== :: Scope -&gt; Scope -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679165533"><span id="local-6989586621679165535"><span id="local-6989586621679165537"><span id="local-6989586621679165539"><span id="local-6989586621679165541"><span id="local-6989586621679165543"><span id="local-6989586621679165545"><span class="annot"><span class="annottext">Eq Scope
Eq Scope =&gt;
(Scope -&gt; Scope -&gt; Ordering)
-&gt; (Scope -&gt; Scope -&gt; Bool)
-&gt; (Scope -&gt; Scope -&gt; Bool)
-&gt; (Scope -&gt; Scope -&gt; Bool)
-&gt; (Scope -&gt; Scope -&gt; Bool)
-&gt; (Scope -&gt; Scope -&gt; Scope)
-&gt; (Scope -&gt; Scope -&gt; Scope)
-&gt; Ord Scope
Scope -&gt; Scope -&gt; Bool
Scope -&gt; Scope -&gt; Ordering
Scope -&gt; Scope -&gt; Scope
forall a.
Eq a =&gt;
(a -&gt; a -&gt; Ordering)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; a)
-&gt; (a -&gt; a -&gt; a)
-&gt; Ord a
min :: Scope -&gt; Scope -&gt; Scope
$cmin :: Scope -&gt; Scope -&gt; Scope
max :: Scope -&gt; Scope -&gt; Scope
$cmax :: Scope -&gt; Scope -&gt; Scope
&gt;= :: Scope -&gt; Scope -&gt; Bool
$c&gt;= :: Scope -&gt; Scope -&gt; Bool
&gt; :: Scope -&gt; Scope -&gt; Bool
$c&gt; :: Scope -&gt; Scope -&gt; Bool
&lt;= :: Scope -&gt; Scope -&gt; Bool
$c&lt;= :: Scope -&gt; Scope -&gt; Bool
&lt; :: Scope -&gt; Scope -&gt; Bool
$c&lt; :: Scope -&gt; Scope -&gt; Bool
compare :: Scope -&gt; Scope -&gt; Ordering
$ccompare :: Scope -&gt; Scope -&gt; Ordering
$cp1Ord :: Eq Scope
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Ord</span></span></span></span></span></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679165531"><span class="annot"><span class="annottext">String -&gt; Scope
(String -&gt; Scope) -&gt; IsString Scope
forall a. (String -&gt; a) -&gt; IsString a
fromString :: String -&gt; Scope
$cfromString :: String -&gt; Scope
</span><span class="hs-identifier hs-var hs-var hs-var hs-var">IsString</span></span></span><span class="hs-special">)</span><span>
</span><span id="line-106"></span><span>
</span><span id="line-107"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679165525"><span id="local-6989586621679165528"><span class="annot"><span class="hs-identifier hs-type">Show</span></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#Scope"><span class="hs-identifier hs-type">Scope</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-108"></span><span>    </span><span id="local-6989586621679165523"><span class="annot"><span class="annottext">show :: Scope -&gt; String
</span><span class="hs-identifier hs-var hs-var hs-var hs-var">show</span></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><span class="hs-identifier hs-var">show</span></span><span> </span><span class="annot"><span class="annottext">(Text -&gt; String) -&gt; (Scope -&gt; Text) -&gt; Scope -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><span class="hs-operator hs-var">.</span></span><span> </span><span class="annot"><span class="annottext">Scope -&gt; Text
</span><a href="TensorFlow.Build.html#unScope"><span class="hs-identifier hs-var hs-var">unScope</span></a></span><span>
</span><span id="line-109"></span><span>
</span><span id="line-110"></span><span class="annot"><a href="TensorFlow.Build.html#opDef"><span class="hs-identifier hs-type">opDef</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Output.html#OpType"><span class="hs-identifier hs-type">OpType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Output.html#OpDef"><span class="hs-identifier hs-type">OpDef</span></a></span><span>
</span><span id="line-111"></span><span id="opDef"><span class="annot"><span class="annottext">opDef :: OpType -&gt; OpDef
</span><a href="TensorFlow.Build.html#opDef"><span class="hs-identifier hs-var hs-var">opDef</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PendingNodeName -&gt; OpType -&gt; OpDef
</span><a href="TensorFlow.Build.html#opDefWithName"><span class="hs-identifier hs-var">opDefWithName</span></a></span><span> </span><span class="annot"><span class="annottext">PendingNodeName
</span><a href="TensorFlow.Output.html#ImplicitName"><span class="hs-identifier hs-var">ImplicitName</span></a></span><span>
</span><span id="line-112"></span><span>
</span><span id="line-113"></span><span class="annot"><a href="TensorFlow.Build.html#opDefWithName"><span class="hs-identifier hs-type">opDefWithName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Output.html#PendingNodeName"><span class="hs-identifier hs-type">PendingNodeName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Output.html#OpType"><span class="hs-identifier hs-type">OpType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Output.html#OpDef"><span class="hs-identifier hs-type">OpDef</span></a></span><span>
</span><span id="line-114"></span><span id="opDefWithName"><span class="annot"><span class="annottext">opDefWithName :: PendingNodeName -&gt; OpType -&gt; OpDef
</span><a href="TensorFlow.Build.html#opDefWithName"><span class="hs-identifier hs-var hs-var">opDefWithName</span></a></span></span><span> </span><span id="local-6989586621679165520"><span class="annot"><span class="annottext">n :: PendingNodeName
</span><a href="#local-6989586621679165520"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679165519"><span class="annot"><span class="annottext">t :: OpType
</span><a href="#local-6989586621679165519"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">$WOpDef :: PendingNodeName
-&gt; OpType -&gt; Map Text AttrValue -&gt; [Output] -&gt; [NodeName] -&gt; OpDef
</span><a href="TensorFlow.Output.html#%24WOpDef"><span class="hs-identifier hs-type hs-type">OpDef</span></a></span><span>
</span><span id="line-115"></span><span>    </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">_opName :: PendingNodeName
</span><a href="TensorFlow.Output.html#_opName"><span class="hs-identifier hs-var">_opName</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PendingNodeName
</span><a href="#local-6989586621679165520"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-116"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">_opType :: OpType
</span><a href="TensorFlow.Output.html#_opType"><span class="hs-identifier hs-var">_opType</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OpType
</span><a href="#local-6989586621679165519"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-117"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">_opAttrs :: Map Text AttrValue
</span><a href="TensorFlow.Output.html#_opAttrs"><span class="hs-identifier hs-var">_opAttrs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Map Text AttrValue
forall k a. Map k a
</span><span class="hs-identifier hs-var">Map.empty</span></span><span>
</span><span id="line-118"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">_opInputs :: [Output]
</span><a href="TensorFlow.Output.html#_opInputs"><span class="hs-identifier hs-var">_opInputs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-119"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">_opControlInputs :: [NodeName]
</span><a href="TensorFlow.Output.html#_opControlInputs"><span class="hs-identifier hs-var">_opControlInputs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-120"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-121"></span><span>
</span><span id="line-122"></span><span class="hs-keyword">data</span><span> </span><span id="GraphState"><span class="annot"><a href="TensorFlow.Build.html#GraphState"><span class="hs-identifier hs-var">GraphState</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="GraphState"><span class="annot"><a href="TensorFlow.Build.html#GraphState"><span class="hs-identifier hs-var">GraphState</span></a></span></span><span>
</span><span id="line-123"></span><span>    </span><span class="hs-special">{</span><span> </span><span id="_renderedNodes"><span class="annot"><span class="annottext">GraphState -&gt; Map PendingNode NodeDef
</span><a href="TensorFlow.Build.html#_renderedNodes"><span class="hs-identifier hs-var hs-var">_renderedNodes</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Map.Map</span></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#PendingNode"><span class="hs-identifier hs-type">PendingNode</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">NodeDef</span></span><span class="hs-special">)</span><span>
</span><span id="line-124"></span><span>        </span><span class="hs-comment">-- ^ Nodes which have been rendered.  Keeps track of the unique ID we</span><span>
</span><span id="line-125"></span><span>        </span><span class="hs-comment">-- assign each implicitly-named node.  Also prevents us from adding the</span><span>
</span><span id="line-126"></span><span>        </span><span class="hs-comment">-- same node (implicit or explicit) more than once to the nodeBuffer.</span><span>
</span><span id="line-127"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="_renderedNodeDefs"><span class="annot"><span class="annottext">GraphState -&gt; Map NodeName NodeDef
</span><a href="TensorFlow.Build.html#_renderedNodeDefs"><span class="hs-identifier hs-var hs-var">_renderedNodeDefs</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Map.Map</span></span><span> </span><span class="annot"><a href="TensorFlow.Output.html#NodeName"><span class="hs-identifier hs-type">NodeName</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">NodeDef</span></span><span class="hs-special">)</span><span>
</span><span id="line-128"></span><span>        </span><span class="hs-comment">-- ^ The NodeDefs of nodes which have been rendered. Used by the</span><span>
</span><span id="line-129"></span><span>        </span><span class="hs-comment">-- Gradient module to inspect the node graph.</span><span>
</span><span id="line-130"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="_nodeBuffer"><span class="annot"><span class="annottext">GraphState -&gt; [NodeDef]
</span><a href="TensorFlow.Build.html#_nodeBuffer"><span class="hs-identifier hs-var hs-var">_nodeBuffer</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">NodeDef</span></span><span class="hs-special">]</span><span>
</span><span id="line-131"></span><span>        </span><span class="hs-comment">-- ^ A list of nodes that should be passed to TensorFlow during</span><span>
</span><span id="line-132"></span><span>        </span><span class="hs-comment">-- the next call to Session.extend (TF_ExtendGraph).</span><span>
</span><span id="line-133"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="_nextUnique"><span class="annot"><span class="annottext">GraphState -&gt; Unique
</span><a href="TensorFlow.Build.html#_nextUnique"><span class="hs-identifier hs-var hs-var">_nextUnique</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="TensorFlow.Build.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span>
</span><span id="line-134"></span><span>        </span><span class="hs-comment">-- ^ Unique ID for the next node</span><span>
</span><span id="line-135"></span><span>    </span><span class="hs-comment">-- TODO(judahjacobson): watch for clashes between auto and user names.</span><span>
</span><span id="line-136"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="_defaultDevice"><span class="annot"><span class="annottext">GraphState -&gt; Maybe Device
</span><a href="TensorFlow.Build.html#_defaultDevice"><span class="hs-identifier hs-var hs-var">_defaultDevice</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Maybe</span></span><span> </span><span class="annot"><a href="TensorFlow.Output.html#Device"><span class="hs-identifier hs-type">Device</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-137"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="_currentScope"><span class="annot"><span class="annottext">GraphState -&gt; [Scope]
</span><a href="TensorFlow.Build.html#_currentScope"><span class="hs-identifier hs-var hs-var">_currentScope</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="TensorFlow.Build.html#Scope"><span class="hs-identifier hs-type">Scope</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-138"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="_defaultControlInputs"><span class="annot"><span class="annottext">GraphState -&gt; Set NodeName
</span><a href="TensorFlow.Build.html#_defaultControlInputs"><span class="hs-identifier hs-var hs-var">_defaultControlInputs</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Set</span></span><span> </span><span class="annot"><a href="TensorFlow.Output.html#NodeName"><span class="hs-identifier hs-type">NodeName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-139"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="_initializationNodes"><span class="annot"><span class="annottext">GraphState -&gt; [NodeName]
</span><a href="TensorFlow.Build.html#_initializationNodes"><span class="hs-identifier hs-var hs-var">_initializationNodes</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="TensorFlow.Output.html#NodeName"><span class="hs-identifier hs-type">NodeName</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-140"></span><span>      </span><span class="hs-comment">-- ^ The nodes to run next time a TF.run is issued, typically</span><span>
</span><span id="line-141"></span><span>      </span><span class="hs-comment">-- variable initializers.</span><span>
</span><span id="line-142"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="_summaries"><span class="annot"><span class="annottext">GraphState -&gt; [Output]
</span><a href="TensorFlow.Build.html#_summaries"><span class="hs-identifier hs-var hs-var">_summaries</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="TensorFlow.Output.html#Output"><span class="hs-identifier hs-type">Output</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-143"></span><span>      </span><span class="hs-comment">-- ^ The tensors for summary (ByteString type)</span><span>
</span><span id="line-144"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-145"></span><span>
</span><span id="line-146"></span><span class="hs-comment">-- | A node definition without its final name.  Used as a key in the</span><span>
</span><span id="line-147"></span><span class="hs-comment">-- &quot;renderedNodes&quot; map.</span><span>
</span><span id="line-148"></span><span class="hs-comment">-- The NodeDef contained inside has an empty &quot;name&quot; field.</span><span>
</span><span id="line-149"></span><span class="hs-keyword">data</span><span> </span><span id="PendingNode"><span class="annot"><a href="TensorFlow.Build.html#PendingNode"><span class="hs-identifier hs-var">PendingNode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="PendingNode"><span class="annot"><a href="TensorFlow.Build.html#PendingNode"><span class="hs-identifier hs-var">PendingNode</span></a></span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="TensorFlow.Build.html#Scope"><span class="hs-identifier hs-type">Scope</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="TensorFlow.Output.html#PendingNodeName"><span class="hs-identifier hs-type">PendingNodeName</span></a></span><span> </span><span class="hs-glyph">!</span><span class="annot"><span class="hs-identifier hs-type">NodeDef</span></span><span>
</span><span id="line-150"></span><span>    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679165496"><span id="local-6989586621679165498"><span class="annot"><span class="annottext">PendingNode -&gt; PendingNode -&gt; Bool
(PendingNode -&gt; PendingNode -&gt; Bool)
-&gt; (PendingNode -&gt; PendingNode -&gt; Bool) -&gt; Eq PendingNode
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: PendingNode -&gt; PendingNode -&gt; Bool
$c/= :: PendingNode -&gt; PendingNode -&gt; Bool
== :: PendingNode -&gt; PendingNode -&gt; Bool
$c== :: PendingNode -&gt; PendingNode -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679165481"><span id="local-6989586621679165483"><span id="local-6989586621679165485"><span id="local-6989586621679165487"><span id="local-6989586621679165489"><span id="local-6989586621679165491"><span id="local-6989586621679165493"><span class="annot"><span class="annottext">Eq PendingNode
Eq PendingNode =&gt;
(PendingNode -&gt; PendingNode -&gt; Ordering)
-&gt; (PendingNode -&gt; PendingNode -&gt; Bool)
-&gt; (PendingNode -&gt; PendingNode -&gt; Bool)
-&gt; (PendingNode -&gt; PendingNode -&gt; Bool)
-&gt; (PendingNode -&gt; PendingNode -&gt; Bool)
-&gt; (PendingNode -&gt; PendingNode -&gt; PendingNode)
-&gt; (PendingNode -&gt; PendingNode -&gt; PendingNode)
-&gt; Ord PendingNode
PendingNode -&gt; PendingNode -&gt; Bool
PendingNode -&gt; PendingNode -&gt; Ordering
PendingNode -&gt; PendingNode -&gt; PendingNode
forall a.
Eq a =&gt;
(a -&gt; a -&gt; Ordering)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; a)
-&gt; (a -&gt; a -&gt; a)
-&gt; Ord a
min :: PendingNode -&gt; PendingNode -&gt; PendingNode
$cmin :: PendingNode -&gt; PendingNode -&gt; PendingNode
max :: PendingNode -&gt; PendingNode -&gt; PendingNode
$cmax :: PendingNode -&gt; PendingNode -&gt; PendingNode
&gt;= :: PendingNode -&gt; PendingNode -&gt; Bool
$c&gt;= :: PendingNode -&gt; PendingNode -&gt; Bool
&gt; :: PendingNode -&gt; PendingNode -&gt; Bool
$c&gt; :: PendingNode -&gt; PendingNode -&gt; Bool
&lt;= :: PendingNode -&gt; PendingNode -&gt; Bool
$c&lt;= :: PendingNode -&gt; PendingNode -&gt; Bool
&lt; :: PendingNode -&gt; PendingNode -&gt; Bool
$c&lt; :: PendingNode -&gt; PendingNode -&gt; Bool
compare :: PendingNode -&gt; PendingNode -&gt; Ordering
$ccompare :: PendingNode -&gt; PendingNode -&gt; Ordering
$cp1Ord :: Eq PendingNode
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Ord</span></span></span></span></span></span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-151"></span><span>
</span><span id="line-152"></span><span class="hs-comment">-- Returns an _incomplete_ NodeDef. The name is fixed by addNewOpFromPending.</span><span>
</span><span id="line-153"></span><span class="annot"><a href="TensorFlow.Build.html#pendingNodeDef"><span class="hs-identifier hs-type">pendingNodeDef</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#PendingNode"><span class="hs-identifier hs-type">PendingNode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">NodeDef</span></span><span>
</span><span id="line-154"></span><span id="pendingNodeDef"><span class="annot"><span class="annottext">pendingNodeDef :: PendingNode -&gt; NodeDef
</span><a href="TensorFlow.Build.html#pendingNodeDef"><span class="hs-identifier hs-var hs-var">pendingNodeDef</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Build.html#PendingNode"><span class="hs-identifier hs-type">PendingNode</span></a></span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-identifier">_</span><span> </span><span id="local-6989586621679165479"><span class="annot"><span class="annottext">n :: NodeDef
</span><a href="#local-6989586621679165479"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NodeDef
</span><a href="#local-6989586621679165479"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-155"></span><span>
</span><span id="line-156"></span><span class="annot"><a href="TensorFlow.Build.html#initGraphState"><span class="hs-identifier hs-type">initGraphState</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#GraphState"><span class="hs-identifier hs-type">GraphState</span></a></span><span>
</span><span id="line-157"></span><span id="initGraphState"><span class="annot"><span class="annottext">initGraphState :: GraphState
</span><a href="TensorFlow.Build.html#initGraphState"><span class="hs-identifier hs-var hs-var">initGraphState</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-158"></span><span>    </span><span class="annot"><span class="annottext">Map PendingNode NodeDef
-&gt; Map NodeName NodeDef
-&gt; [NodeDef]
-&gt; Unique
-&gt; Maybe Device
-&gt; [Scope]
-&gt; Set NodeName
-&gt; [NodeName]
-&gt; [Output]
-&gt; GraphState
</span><a href="TensorFlow.Build.html#GraphState"><span class="hs-identifier hs-var">GraphState</span></a></span><span> </span><span class="annot"><span class="annottext">Map PendingNode NodeDef
forall k a. Map k a
</span><span class="hs-identifier hs-var">Map.empty</span></span><span> </span><span class="annot"><span class="annottext">Map NodeName NodeDef
forall k a. Map k a
</span><span class="hs-identifier hs-var">Map.empty</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Unique
</span><a href="TensorFlow.Build.html#Unique"><span class="hs-identifier hs-var">Unique</span></a></span><span> </span><span class="annot"><span class="hs-number">0</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe Device
forall a. Maybe a
</span><span class="hs-identifier hs-var">Nothing</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Set NodeName
forall a. Set a
</span><span class="hs-identifier hs-var">Set.empty</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-159"></span><span>
</span><span id="line-160"></span><span class="annot"><a href="TensorFlow.Build.html#renderedNodes"><span class="hs-identifier hs-type">renderedNodes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Lens'</span></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#GraphState"><span class="hs-identifier hs-type">GraphState</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Map.Map</span></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#PendingNode"><span class="hs-identifier hs-type">PendingNode</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">NodeDef</span></span><span class="hs-special">)</span><span>
</span><span id="line-161"></span><span id="renderedNodes"><span class="annot"><span class="annottext">renderedNodes :: LensLike' f GraphState (Map PendingNode NodeDef)
</span><a href="TensorFlow.Build.html#renderedNodes"><span class="hs-identifier hs-var hs-var">renderedNodes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GraphState -&gt; Map PendingNode NodeDef)
-&gt; (GraphState -&gt; Map PendingNode NodeDef -&gt; GraphState)
-&gt; Lens
     GraphState
     GraphState
     (Map PendingNode NodeDef)
     (Map PendingNode NodeDef)
forall s a b t. (s -&gt; a) -&gt; (s -&gt; b -&gt; t) -&gt; Lens s t a b
</span><span class="hs-identifier hs-var">lens</span></span><span> </span><span class="annot"><span class="annottext">GraphState -&gt; Map PendingNode NodeDef
</span><a href="TensorFlow.Build.html#_renderedNodes"><span class="hs-identifier hs-var hs-var">_renderedNodes</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679165475"><span class="annot"><span class="annottext">g :: GraphState
</span><a href="#local-6989586621679165475"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679165474"><span class="annot"><span class="annottext">x :: Map PendingNode NodeDef
</span><a href="#local-6989586621679165474"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GraphState
</span><a href="#local-6989586621679165475"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">_renderedNodes :: Map PendingNode NodeDef
</span><a href="TensorFlow.Build.html#_renderedNodes"><span class="hs-identifier hs-var">_renderedNodes</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Map PendingNode NodeDef
</span><a href="#local-6989586621679165474"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-162"></span><span>
</span><span id="line-163"></span><span class="annot"><a href="TensorFlow.Build.html#renderedNodeDefs"><span class="hs-identifier hs-type">renderedNodeDefs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Lens'</span></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#GraphState"><span class="hs-identifier hs-type">GraphState</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Map.Map</span></span><span> </span><span class="annot"><a href="TensorFlow.Output.html#NodeName"><span class="hs-identifier hs-type">NodeName</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">NodeDef</span></span><span class="hs-special">)</span><span>
</span><span id="line-164"></span><span id="renderedNodeDefs"><span class="annot"><span class="annottext">renderedNodeDefs :: LensLike' f GraphState (Map NodeName NodeDef)
</span><a href="TensorFlow.Build.html#renderedNodeDefs"><span class="hs-identifier hs-var hs-var">renderedNodeDefs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GraphState -&gt; Map NodeName NodeDef)
-&gt; (GraphState -&gt; Map NodeName NodeDef -&gt; GraphState)
-&gt; Lens
     GraphState GraphState (Map NodeName NodeDef) (Map NodeName NodeDef)
forall s a b t. (s -&gt; a) -&gt; (s -&gt; b -&gt; t) -&gt; Lens s t a b
</span><span class="hs-identifier hs-var">lens</span></span><span> </span><span class="annot"><span class="annottext">GraphState -&gt; Map NodeName NodeDef
</span><a href="TensorFlow.Build.html#_renderedNodeDefs"><span class="hs-identifier hs-var hs-var">_renderedNodeDefs</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679165473"><span class="annot"><span class="annottext">g :: GraphState
</span><a href="#local-6989586621679165473"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679165472"><span class="annot"><span class="annottext">x :: Map NodeName NodeDef
</span><a href="#local-6989586621679165472"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GraphState
</span><a href="#local-6989586621679165473"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">_renderedNodeDefs :: Map NodeName NodeDef
</span><a href="TensorFlow.Build.html#_renderedNodeDefs"><span class="hs-identifier hs-var">_renderedNodeDefs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Map NodeName NodeDef
</span><a href="#local-6989586621679165472"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-165"></span><span>
</span><span id="line-166"></span><span class="annot"><a href="TensorFlow.Build.html#nodeBuffer"><span class="hs-identifier hs-type">nodeBuffer</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Lens'</span></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#GraphState"><span class="hs-identifier hs-type">GraphState</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">NodeDef</span></span><span class="hs-special">]</span><span>
</span><span id="line-167"></span><span id="nodeBuffer"><span class="annot"><span class="annottext">nodeBuffer :: LensLike' f GraphState [NodeDef]
</span><a href="TensorFlow.Build.html#nodeBuffer"><span class="hs-identifier hs-var hs-var">nodeBuffer</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GraphState -&gt; [NodeDef])
-&gt; (GraphState -&gt; [NodeDef] -&gt; GraphState)
-&gt; Lens GraphState GraphState [NodeDef] [NodeDef]
forall s a b t. (s -&gt; a) -&gt; (s -&gt; b -&gt; t) -&gt; Lens s t a b
</span><span class="hs-identifier hs-var">lens</span></span><span> </span><span class="annot"><span class="annottext">GraphState -&gt; [NodeDef]
</span><a href="TensorFlow.Build.html#_nodeBuffer"><span class="hs-identifier hs-var hs-var">_nodeBuffer</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679165470"><span class="annot"><span class="annottext">g :: GraphState
</span><a href="#local-6989586621679165470"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679165469"><span class="annot"><span class="annottext">x :: [NodeDef]
</span><a href="#local-6989586621679165469"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GraphState
</span><a href="#local-6989586621679165470"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">_nodeBuffer :: [NodeDef]
</span><a href="TensorFlow.Build.html#_nodeBuffer"><span class="hs-identifier hs-var">_nodeBuffer</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[NodeDef]
</span><a href="#local-6989586621679165469"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-168"></span><span>
</span><span id="line-169"></span><span class="annot"><a href="TensorFlow.Build.html#nextUnique"><span class="hs-identifier hs-type">nextUnique</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Lens'</span></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#GraphState"><span class="hs-identifier hs-type">GraphState</span></a></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span>
</span><span id="line-170"></span><span id="nextUnique"><span class="annot"><span class="annottext">nextUnique :: LensLike' f GraphState Unique
</span><a href="TensorFlow.Build.html#nextUnique"><span class="hs-identifier hs-var hs-var">nextUnique</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GraphState -&gt; Unique)
-&gt; (GraphState -&gt; Unique -&gt; GraphState)
-&gt; Lens GraphState GraphState Unique Unique
forall s a b t. (s -&gt; a) -&gt; (s -&gt; b -&gt; t) -&gt; Lens s t a b
</span><span class="hs-identifier hs-var">lens</span></span><span> </span><span class="annot"><span class="annottext">GraphState -&gt; Unique
</span><a href="TensorFlow.Build.html#_nextUnique"><span class="hs-identifier hs-var hs-var">_nextUnique</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679165467"><span class="annot"><span class="annottext">g :: GraphState
</span><a href="#local-6989586621679165467"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679165466"><span class="annot"><span class="annottext">x :: Unique
</span><a href="#local-6989586621679165466"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GraphState
</span><a href="#local-6989586621679165467"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">_nextUnique :: Unique
</span><a href="TensorFlow.Build.html#_nextUnique"><span class="hs-identifier hs-var">_nextUnique</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621679165466"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-171"></span><span>
</span><span id="line-172"></span><span class="annot"><a href="TensorFlow.Build.html#defaultDevice"><span class="hs-identifier hs-type">defaultDevice</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Lens'</span></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#GraphState"><span class="hs-identifier hs-type">GraphState</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Maybe</span></span><span> </span><span class="annot"><a href="TensorFlow.Output.html#Device"><span class="hs-identifier hs-type">Device</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-173"></span><span id="defaultDevice"><span class="annot"><span class="annottext">defaultDevice :: LensLike' f GraphState (Maybe Device)
</span><a href="TensorFlow.Build.html#defaultDevice"><span class="hs-identifier hs-var hs-var">defaultDevice</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GraphState -&gt; Maybe Device)
-&gt; (GraphState -&gt; Maybe Device -&gt; GraphState)
-&gt; Lens GraphState GraphState (Maybe Device) (Maybe Device)
forall s a b t. (s -&gt; a) -&gt; (s -&gt; b -&gt; t) -&gt; Lens s t a b
</span><span class="hs-identifier hs-var">lens</span></span><span> </span><span class="annot"><span class="annottext">GraphState -&gt; Maybe Device
</span><a href="TensorFlow.Build.html#_defaultDevice"><span class="hs-identifier hs-var hs-var">_defaultDevice</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679165464"><span class="annot"><span class="annottext">g :: GraphState
</span><a href="#local-6989586621679165464"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679165463"><span class="annot"><span class="annottext">x :: Maybe Device
</span><a href="#local-6989586621679165463"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GraphState
</span><a href="#local-6989586621679165464"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">_defaultDevice :: Maybe Device
</span><a href="TensorFlow.Build.html#_defaultDevice"><span class="hs-identifier hs-var">_defaultDevice</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Device
</span><a href="#local-6989586621679165463"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-174"></span><span>
</span><span id="line-175"></span><span class="annot"><a href="TensorFlow.Build.html#currentScope"><span class="hs-identifier hs-type">currentScope</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Lens'</span></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#GraphState"><span class="hs-identifier hs-type">GraphState</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="TensorFlow.Build.html#Scope"><span class="hs-identifier hs-type">Scope</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-176"></span><span id="currentScope"><span class="annot"><span class="annottext">currentScope :: LensLike' f GraphState [Scope]
</span><a href="TensorFlow.Build.html#currentScope"><span class="hs-identifier hs-var hs-var">currentScope</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GraphState -&gt; [Scope])
-&gt; (GraphState -&gt; [Scope] -&gt; GraphState)
-&gt; Lens GraphState GraphState [Scope] [Scope]
forall s a b t. (s -&gt; a) -&gt; (s -&gt; b -&gt; t) -&gt; Lens s t a b
</span><span class="hs-identifier hs-var">lens</span></span><span> </span><span class="annot"><span class="annottext">GraphState -&gt; [Scope]
</span><a href="TensorFlow.Build.html#_currentScope"><span class="hs-identifier hs-var hs-var">_currentScope</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679165461"><span class="annot"><span class="annottext">g :: GraphState
</span><a href="#local-6989586621679165461"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679165460"><span class="annot"><span class="annottext">x :: [Scope]
</span><a href="#local-6989586621679165460"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GraphState
</span><a href="#local-6989586621679165461"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">_currentScope :: [Scope]
</span><a href="TensorFlow.Build.html#_currentScope"><span class="hs-identifier hs-var">_currentScope</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Scope]
</span><a href="#local-6989586621679165460"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-177"></span><span>
</span><span id="line-178"></span><span class="annot"><a href="TensorFlow.Build.html#defaultControlInputs"><span class="hs-identifier hs-type">defaultControlInputs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Lens'</span></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#GraphState"><span class="hs-identifier hs-type">GraphState</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Set</span></span><span> </span><span class="annot"><a href="TensorFlow.Output.html#NodeName"><span class="hs-identifier hs-type">NodeName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-179"></span><span id="defaultControlInputs"><span class="annot"><span class="annottext">defaultControlInputs :: LensLike' f GraphState (Set NodeName)
</span><a href="TensorFlow.Build.html#defaultControlInputs"><span class="hs-identifier hs-var hs-var">defaultControlInputs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GraphState -&gt; Set NodeName)
-&gt; (GraphState -&gt; Set NodeName -&gt; GraphState)
-&gt; Lens GraphState GraphState (Set NodeName) (Set NodeName)
forall s a b t. (s -&gt; a) -&gt; (s -&gt; b -&gt; t) -&gt; Lens s t a b
</span><span class="hs-identifier hs-var">lens</span></span><span> </span><span class="annot"><span class="annottext">GraphState -&gt; Set NodeName
</span><a href="TensorFlow.Build.html#_defaultControlInputs"><span class="hs-identifier hs-var hs-var">_defaultControlInputs</span></a></span><span>
</span><span id="line-180"></span><span>                          </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679165458"><span class="annot"><span class="annottext">g :: GraphState
</span><a href="#local-6989586621679165458"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679165457"><span class="annot"><span class="annottext">x :: Set NodeName
</span><a href="#local-6989586621679165457"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GraphState
</span><a href="#local-6989586621679165458"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">_defaultControlInputs :: Set NodeName
</span><a href="TensorFlow.Build.html#_defaultControlInputs"><span class="hs-identifier hs-var">_defaultControlInputs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set NodeName
</span><a href="#local-6989586621679165457"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span class="annot"><a href="TensorFlow.Build.html#initializationNodes"><span class="hs-identifier hs-type">initializationNodes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Lens'</span></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#GraphState"><span class="hs-identifier hs-type">GraphState</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="TensorFlow.Output.html#NodeName"><span class="hs-identifier hs-type">NodeName</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-183"></span><span id="initializationNodes"><span class="annot"><span class="annottext">initializationNodes :: LensLike' f GraphState [NodeName]
</span><a href="TensorFlow.Build.html#initializationNodes"><span class="hs-identifier hs-var hs-var">initializationNodes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GraphState -&gt; [NodeName])
-&gt; (GraphState -&gt; [NodeName] -&gt; GraphState)
-&gt; Lens GraphState GraphState [NodeName] [NodeName]
forall s a b t. (s -&gt; a) -&gt; (s -&gt; b -&gt; t) -&gt; Lens s t a b
</span><span class="hs-identifier hs-var">lens</span></span><span> </span><span class="annot"><span class="annottext">GraphState -&gt; [NodeName]
</span><a href="TensorFlow.Build.html#_initializationNodes"><span class="hs-identifier hs-var hs-var">_initializationNodes</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679165455"><span class="annot"><span class="annottext">g :: GraphState
</span><a href="#local-6989586621679165455"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679165454"><span class="annot"><span class="annottext">x :: [NodeName]
</span><a href="#local-6989586621679165454"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GraphState
</span><a href="#local-6989586621679165455"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">_initializationNodes :: [NodeName]
</span><a href="TensorFlow.Build.html#_initializationNodes"><span class="hs-identifier hs-var">_initializationNodes</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[NodeName]
</span><a href="#local-6989586621679165454"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-184"></span><span>
</span><span id="line-185"></span><span class="annot"><a href="TensorFlow.Build.html#summaries"><span class="hs-identifier hs-type">summaries</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Lens'</span></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#GraphState"><span class="hs-identifier hs-type">GraphState</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="TensorFlow.Output.html#Output"><span class="hs-identifier hs-type">Output</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-186"></span><span id="summaries"><span class="annot"><span class="annottext">summaries :: LensLike' f GraphState [Output]
</span><a href="TensorFlow.Build.html#summaries"><span class="hs-identifier hs-var hs-var">summaries</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GraphState -&gt; [Output])
-&gt; (GraphState -&gt; [Output] -&gt; GraphState)
-&gt; Lens GraphState GraphState [Output] [Output]
forall s a b t. (s -&gt; a) -&gt; (s -&gt; b -&gt; t) -&gt; Lens s t a b
</span><span class="hs-identifier hs-var">lens</span></span><span> </span><span class="annot"><span class="annottext">GraphState -&gt; [Output]
</span><a href="TensorFlow.Build.html#_summaries"><span class="hs-identifier hs-var hs-var">_summaries</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679165453"><span class="annot"><span class="annottext">g :: GraphState
</span><a href="#local-6989586621679165453"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679165452"><span class="annot"><span class="annottext">x :: [Output]
</span><a href="#local-6989586621679165452"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GraphState
</span><a href="#local-6989586621679165453"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">_summaries :: [Output]
</span><a href="TensorFlow.Build.html#_summaries"><span class="hs-identifier hs-var">_summaries</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Output]
</span><a href="#local-6989586621679165452"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-187"></span><span>
</span><span id="line-188"></span><span class="hs-comment">-- | An action for building nodes in a TensorFlow graph.</span><span>
</span><span id="line-189"></span><span class="hs-comment">-- Used to manage build state internally as part of the @Session@ monad.</span><span>
</span><span id="line-190"></span><span class="hs-keyword">newtype</span><span> </span><span id="BuildT"><span class="annot"><a href="TensorFlow.Build.html#BuildT"><span class="hs-identifier hs-var">BuildT</span></a></span></span><span> </span><span id="local-6989586621679165782"><span class="annot"><a href="#local-6989586621679165782"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span id="local-6989586621679165781"><span class="annot"><a href="#local-6989586621679165781"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="BuildT"><span class="annot"><a href="TensorFlow.Build.html#BuildT"><span class="hs-identifier hs-var">BuildT</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">StateT</span></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#GraphState"><span class="hs-identifier hs-type">GraphState</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165782"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165781"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-191"></span><span>    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679165447"><span id="local-6989586621679165449"><span class="annot"><span class="annottext">a -&gt; BuildT m b -&gt; BuildT m a
(a -&gt; b) -&gt; BuildT m a -&gt; BuildT m b
(forall a b. (a -&gt; b) -&gt; BuildT m a -&gt; BuildT m b)
-&gt; (forall a b. a -&gt; BuildT m b -&gt; BuildT m a)
-&gt; Functor (BuildT m)
forall a b. a -&gt; BuildT m b -&gt; BuildT m a
forall a b. (a -&gt; b) -&gt; BuildT m a -&gt; BuildT m b
forall (m :: * -&gt; *) a b.
Functor m =&gt;
a -&gt; BuildT m b -&gt; BuildT m a
forall (m :: * -&gt; *) a b.
Functor m =&gt;
(a -&gt; b) -&gt; BuildT m a -&gt; BuildT m b
forall (f :: * -&gt; *).
(forall a b. (a -&gt; b) -&gt; f a -&gt; f b)
-&gt; (forall a b. a -&gt; f b -&gt; f a) -&gt; Functor f
&lt;$ :: a -&gt; BuildT m b -&gt; BuildT m a
$c&lt;$ :: forall (m :: * -&gt; *) a b.
Functor m =&gt;
a -&gt; BuildT m b -&gt; BuildT m a
fmap :: (a -&gt; b) -&gt; BuildT m a -&gt; BuildT m b
$cfmap :: forall (m :: * -&gt; *) a b.
Functor m =&gt;
(a -&gt; b) -&gt; BuildT m a -&gt; BuildT m b
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Functor</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679165435"><span id="local-6989586621679165437"><span id="local-6989586621679165439"><span id="local-6989586621679165441"><span id="local-6989586621679165443"><span class="annot"><span class="annottext">Functor (BuildT m)
a -&gt; BuildT m a
Functor (BuildT m) =&gt;
(forall a. a -&gt; BuildT m a)
-&gt; (forall a b. BuildT m (a -&gt; b) -&gt; BuildT m a -&gt; BuildT m b)
-&gt; (forall a b c.
    (a -&gt; b -&gt; c) -&gt; BuildT m a -&gt; BuildT m b -&gt; BuildT m c)
-&gt; (forall a b. BuildT m a -&gt; BuildT m b -&gt; BuildT m b)
-&gt; (forall a b. BuildT m a -&gt; BuildT m b -&gt; BuildT m a)
-&gt; Applicative (BuildT m)
BuildT m a -&gt; BuildT m b -&gt; BuildT m b
BuildT m a -&gt; BuildT m b -&gt; BuildT m a
BuildT m (a -&gt; b) -&gt; BuildT m a -&gt; BuildT m b
(a -&gt; b -&gt; c) -&gt; BuildT m a -&gt; BuildT m b -&gt; BuildT m c
forall a. a -&gt; BuildT m a
forall a b. BuildT m a -&gt; BuildT m b -&gt; BuildT m a
forall a b. BuildT m a -&gt; BuildT m b -&gt; BuildT m b
forall a b. BuildT m (a -&gt; b) -&gt; BuildT m a -&gt; BuildT m b
forall a b c.
(a -&gt; b -&gt; c) -&gt; BuildT m a -&gt; BuildT m b -&gt; BuildT m c
forall (m :: * -&gt; *). Monad m =&gt; Functor (BuildT m)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; BuildT m a
forall (m :: * -&gt; *) a b.
Monad m =&gt;
BuildT m a -&gt; BuildT m b -&gt; BuildT m a
forall (m :: * -&gt; *) a b.
Monad m =&gt;
BuildT m a -&gt; BuildT m b -&gt; BuildT m b
forall (m :: * -&gt; *) a b.
Monad m =&gt;
BuildT m (a -&gt; b) -&gt; BuildT m a -&gt; BuildT m b
forall (m :: * -&gt; *) a b c.
Monad m =&gt;
(a -&gt; b -&gt; c) -&gt; BuildT m a -&gt; BuildT m b -&gt; BuildT m c
forall (f :: * -&gt; *).
Functor f =&gt;
(forall a. a -&gt; f a)
-&gt; (forall a b. f (a -&gt; b) -&gt; f a -&gt; f b)
-&gt; (forall a b c. (a -&gt; b -&gt; c) -&gt; f a -&gt; f b -&gt; f c)
-&gt; (forall a b. f a -&gt; f b -&gt; f b)
-&gt; (forall a b. f a -&gt; f b -&gt; f a)
-&gt; Applicative f
&lt;* :: BuildT m a -&gt; BuildT m b -&gt; BuildT m a
$c&lt;* :: forall (m :: * -&gt; *) a b.
Monad m =&gt;
BuildT m a -&gt; BuildT m b -&gt; BuildT m a
*&gt; :: BuildT m a -&gt; BuildT m b -&gt; BuildT m b
$c*&gt; :: forall (m :: * -&gt; *) a b.
Monad m =&gt;
BuildT m a -&gt; BuildT m b -&gt; BuildT m b
liftA2 :: (a -&gt; b -&gt; c) -&gt; BuildT m a -&gt; BuildT m b -&gt; BuildT m c
$cliftA2 :: forall (m :: * -&gt; *) a b c.
Monad m =&gt;
(a -&gt; b -&gt; c) -&gt; BuildT m a -&gt; BuildT m b -&gt; BuildT m c
&lt;*&gt; :: BuildT m (a -&gt; b) -&gt; BuildT m a -&gt; BuildT m b
$c&lt;*&gt; :: forall (m :: * -&gt; *) a b.
Monad m =&gt;
BuildT m (a -&gt; b) -&gt; BuildT m a -&gt; BuildT m b
pure :: a -&gt; BuildT m a
$cpure :: forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; BuildT m a
$cp1Applicative :: forall (m :: * -&gt; *). Monad m =&gt; Functor (BuildT m)
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Applicative</span></span></span></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679165427"><span id="local-6989586621679165429"><span id="local-6989586621679165431"><span class="annot"><span class="annottext">Applicative (BuildT m)
a -&gt; BuildT m a
Applicative (BuildT m) =&gt;
(forall a b. BuildT m a -&gt; (a -&gt; BuildT m b) -&gt; BuildT m b)
-&gt; (forall a b. BuildT m a -&gt; BuildT m b -&gt; BuildT m b)
-&gt; (forall a. a -&gt; BuildT m a)
-&gt; Monad (BuildT m)
BuildT m a -&gt; (a -&gt; BuildT m b) -&gt; BuildT m b
BuildT m a -&gt; BuildT m b -&gt; BuildT m b
forall a. a -&gt; BuildT m a
forall a b. BuildT m a -&gt; BuildT m b -&gt; BuildT m b
forall a b. BuildT m a -&gt; (a -&gt; BuildT m b) -&gt; BuildT m b
forall (m :: * -&gt; *). Monad m =&gt; Applicative (BuildT m)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; BuildT m a
forall (m :: * -&gt; *) a b.
Monad m =&gt;
BuildT m a -&gt; BuildT m b -&gt; BuildT m b
forall (m :: * -&gt; *) a b.
Monad m =&gt;
BuildT m a -&gt; (a -&gt; BuildT m b) -&gt; BuildT m b
forall (m :: * -&gt; *).
Applicative m =&gt;
(forall a b. m a -&gt; (a -&gt; m b) -&gt; m b)
-&gt; (forall a b. m a -&gt; m b -&gt; m b)
-&gt; (forall a. a -&gt; m a)
-&gt; Monad m
return :: a -&gt; BuildT m a
$creturn :: forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; BuildT m a
&gt;&gt; :: BuildT m a -&gt; BuildT m b -&gt; BuildT m b
$c&gt;&gt; :: forall (m :: * -&gt; *) a b.
Monad m =&gt;
BuildT m a -&gt; BuildT m b -&gt; BuildT m b
&gt;&gt;= :: BuildT m a -&gt; (a -&gt; BuildT m b) -&gt; BuildT m b
$c&gt;&gt;= :: forall (m :: * -&gt; *) a b.
Monad m =&gt;
BuildT m a -&gt; (a -&gt; BuildT m b) -&gt; BuildT m b
$cp1Monad :: forall (m :: * -&gt; *). Monad m =&gt; Applicative (BuildT m)
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Monad</span></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679165423"><span class="annot"><span class="annottext">Monad (BuildT m)
Monad (BuildT m) =&gt;
(forall a. IO a -&gt; BuildT m a) -&gt; MonadIO (BuildT m)
IO a -&gt; BuildT m a
forall a. IO a -&gt; BuildT m a
forall (m :: * -&gt; *).
Monad m =&gt;
(forall a. IO a -&gt; m a) -&gt; MonadIO m
forall (m :: * -&gt; *). MonadIO m =&gt; Monad (BuildT m)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; BuildT m a
liftIO :: IO a -&gt; BuildT m a
$cliftIO :: forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; BuildT m a
$cp1MonadIO :: forall (m :: * -&gt; *). MonadIO m =&gt; Monad (BuildT m)
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var">MonadIO</span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679165420"><span class="annot"><span class="annottext">m a -&gt; BuildT m a
(forall (m :: * -&gt; *) a. Monad m =&gt; m a -&gt; BuildT m a)
-&gt; MonadTrans BuildT
forall (m :: * -&gt; *) a. Monad m =&gt; m a -&gt; BuildT m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *).
(forall (m :: * -&gt; *) a. Monad m =&gt; m a -&gt; t m a) -&gt; MonadTrans t
lift :: m a -&gt; BuildT m a
$clift :: forall (m :: * -&gt; *) a. Monad m =&gt; m a -&gt; BuildT m a
</span><span class="hs-identifier hs-var hs-var hs-var hs-var">MonadTrans</span></span></span><span class="hs-special">,</span><span>
</span><span id="line-192"></span><span>              </span><span id="local-6989586621679165412"><span id="local-6989586621679165414"><span id="local-6989586621679165416"><span class="annot"><span class="hs-identifier hs-type">MonadState</span></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#GraphState"><span class="hs-identifier hs-type">GraphState</span></a></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679165408"><span class="annot"><span class="annottext">Monad (BuildT m)
e -&gt; BuildT m a
Monad (BuildT m) =&gt;
(forall e a. Exception e =&gt; e -&gt; BuildT m a)
-&gt; MonadThrow (BuildT m)
forall e a. Exception e =&gt; e -&gt; BuildT m a
forall (m :: * -&gt; *).
Monad m =&gt;
(forall e a. Exception e =&gt; e -&gt; m a) -&gt; MonadThrow m
forall (m :: * -&gt; *). MonadThrow m =&gt; Monad (BuildT m)
forall (m :: * -&gt; *) e a.
(MonadThrow m, Exception e) =&gt;
e -&gt; BuildT m a
throwM :: e -&gt; BuildT m a
$cthrowM :: forall (m :: * -&gt; *) e a.
(MonadThrow m, Exception e) =&gt;
e -&gt; BuildT m a
$cp1MonadThrow :: forall (m :: * -&gt; *). MonadThrow m =&gt; Monad (BuildT m)
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var">MonadThrow</span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679165404"><span class="annot"><span class="annottext">MonadThrow (BuildT m)
MonadThrow (BuildT m) =&gt;
(forall e a.
 Exception e =&gt;
 BuildT m a -&gt; (e -&gt; BuildT m a) -&gt; BuildT m a)
-&gt; MonadCatch (BuildT m)
BuildT m a -&gt; (e -&gt; BuildT m a) -&gt; BuildT m a
forall e a.
Exception e =&gt;
BuildT m a -&gt; (e -&gt; BuildT m a) -&gt; BuildT m a
forall (m :: * -&gt; *). MonadCatch m =&gt; MonadThrow (BuildT m)
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
BuildT m a -&gt; (e -&gt; BuildT m a) -&gt; BuildT m a
forall (m :: * -&gt; *).
MonadThrow m =&gt;
(forall e a. Exception e =&gt; m a -&gt; (e -&gt; m a) -&gt; m a)
-&gt; MonadCatch m
catch :: BuildT m a -&gt; (e -&gt; BuildT m a) -&gt; BuildT m a
$ccatch :: forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
BuildT m a -&gt; (e -&gt; BuildT m a) -&gt; BuildT m a
$cp1MonadCatch :: forall (m :: * -&gt; *). MonadCatch m =&gt; MonadThrow (BuildT m)
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var">MonadCatch</span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679165396"><span id="local-6989586621679165398"><span id="local-6989586621679165400"><span class="annot"><span class="annottext">MonadCatch (BuildT m)
MonadCatch (BuildT m) =&gt;
(forall b.
 ((forall a. BuildT m a -&gt; BuildT m a) -&gt; BuildT m b) -&gt; BuildT m b)
-&gt; (forall b.
    ((forall a. BuildT m a -&gt; BuildT m a) -&gt; BuildT m b) -&gt; BuildT m b)
-&gt; (forall a b c.
    BuildT m a
    -&gt; (a -&gt; ExitCase b -&gt; BuildT m c)
    -&gt; (a -&gt; BuildT m b)
    -&gt; BuildT m (b, c))
-&gt; MonadMask (BuildT m)
BuildT m a
-&gt; (a -&gt; ExitCase b -&gt; BuildT m c)
-&gt; (a -&gt; BuildT m b)
-&gt; BuildT m (b, c)
((forall a. BuildT m a -&gt; BuildT m a) -&gt; BuildT m b) -&gt; BuildT m b
((forall a. BuildT m a -&gt; BuildT m a) -&gt; BuildT m b) -&gt; BuildT m b
forall b.
((forall a. BuildT m a -&gt; BuildT m a) -&gt; BuildT m b) -&gt; BuildT m b
forall a b c.
BuildT m a
-&gt; (a -&gt; ExitCase b -&gt; BuildT m c)
-&gt; (a -&gt; BuildT m b)
-&gt; BuildT m (b, c)
forall (m :: * -&gt; *).
MonadCatch m =&gt;
(forall b. ((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b)
-&gt; (forall b. ((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b)
-&gt; (forall a b c.
    m a -&gt; (a -&gt; ExitCase b -&gt; m c) -&gt; (a -&gt; m b) -&gt; m (b, c))
-&gt; MonadMask m
forall (m :: * -&gt; *). MonadMask m =&gt; MonadCatch (BuildT m)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. BuildT m a -&gt; BuildT m a) -&gt; BuildT m b) -&gt; BuildT m b
forall (m :: * -&gt; *) a b c.
MonadMask m =&gt;
BuildT m a
-&gt; (a -&gt; ExitCase b -&gt; BuildT m c)
-&gt; (a -&gt; BuildT m b)
-&gt; BuildT m (b, c)
generalBracket :: BuildT m a
-&gt; (a -&gt; ExitCase b -&gt; BuildT m c)
-&gt; (a -&gt; BuildT m b)
-&gt; BuildT m (b, c)
$cgeneralBracket :: forall (m :: * -&gt; *) a b c.
MonadMask m =&gt;
BuildT m a
-&gt; (a -&gt; ExitCase b -&gt; BuildT m c)
-&gt; (a -&gt; BuildT m b)
-&gt; BuildT m (b, c)
uninterruptibleMask :: ((forall a. BuildT m a -&gt; BuildT m a) -&gt; BuildT m b) -&gt; BuildT m b
$cuninterruptibleMask :: forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. BuildT m a -&gt; BuildT m a) -&gt; BuildT m b) -&gt; BuildT m b
mask :: ((forall a. BuildT m a -&gt; BuildT m a) -&gt; BuildT m b) -&gt; BuildT m b
$cmask :: forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. BuildT m a -&gt; BuildT m a) -&gt; BuildT m b) -&gt; BuildT m b
$cp1MonadMask :: forall (m :: * -&gt; *). MonadMask m =&gt; MonadCatch (BuildT m)
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">MonadMask</span></span></span></span></span><span class="hs-special">,</span><span>
</span><span id="line-193"></span><span>              </span><span id="local-6989586621679165392"><span class="annot"><span class="annottext">Monad (BuildT m)
Monad (BuildT m) =&gt;
(forall a. (a -&gt; BuildT m a) -&gt; BuildT m a) -&gt; MonadFix (BuildT m)
(a -&gt; BuildT m a) -&gt; BuildT m a
forall a. (a -&gt; BuildT m a) -&gt; BuildT m a
forall (m :: * -&gt; *).
Monad m =&gt;
(forall a. (a -&gt; m a) -&gt; m a) -&gt; MonadFix m
forall (m :: * -&gt; *). MonadFix m =&gt; Monad (BuildT m)
forall (m :: * -&gt; *) a.
MonadFix m =&gt;
(a -&gt; BuildT m a) -&gt; BuildT m a
mfix :: (a -&gt; BuildT m a) -&gt; BuildT m a
$cmfix :: forall (m :: * -&gt; *) a.
MonadFix m =&gt;
(a -&gt; BuildT m a) -&gt; BuildT m a
$cp1MonadFix :: forall (m :: * -&gt; *). MonadFix m =&gt; Monad (BuildT m)
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var">MonadFix</span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679165388"><span class="annot"><span class="annottext">Monad (BuildT m)
Monad (BuildT m) =&gt;
(forall a. String -&gt; BuildT m a) -&gt; MonadFail (BuildT m)
String -&gt; BuildT m a
forall a. String -&gt; BuildT m a
forall (m :: * -&gt; *).
Monad m =&gt;
(forall a. String -&gt; m a) -&gt; MonadFail m
forall (m :: * -&gt; *). MonadFail m =&gt; Monad (BuildT m)
forall (m :: * -&gt; *) a. MonadFail m =&gt; String -&gt; BuildT m a
fail :: String -&gt; BuildT m a
$cfail :: forall (m :: * -&gt; *) a. MonadFail m =&gt; String -&gt; BuildT m a
$cp1MonadFail :: forall (m :: * -&gt; *). MonadFail m =&gt; Monad (BuildT m)
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var">MonadFail</span></span></span><span class="hs-special">)</span><span>
</span><span id="line-194"></span><span>
</span><span id="line-195"></span><span class="hs-comment">-- | An action for building nodes in a TensorFlow graph.</span><span>
</span><span id="line-196"></span><span class="hs-keyword">type</span><span> </span><span id="Build"><span class="annot"><a href="TensorFlow.Build.html#Build"><span class="hs-identifier hs-var">Build</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#BuildT"><span class="hs-identifier hs-type">BuildT</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Identity</span></span><span>
</span><span id="line-197"></span><span>
</span><span id="line-198"></span><span class="hs-comment">-- | This is Control.Monad.Morph.hoist sans the dependency.</span><span>
</span><span id="line-199"></span><span id="local-6989586621679165753"><span id="local-6989586621679165754"><span id="local-6989586621679165755"><span class="annot"><a href="TensorFlow.Build.html#hoistBuildT"><span class="hs-identifier hs-type">hoistBuildT</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679165786"><span class="annot"><a href="#local-6989586621679165786"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="#local-6989586621679165755"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165786"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679165754"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165786"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#BuildT"><span class="hs-identifier hs-type">BuildT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165755"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165753"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#BuildT"><span class="hs-identifier hs-type">BuildT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165754"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165753"><span class="hs-identifier hs-type">b</span></a></span></span></span></span><span>
</span><span id="line-200"></span><span id="hoistBuildT"><span class="annot"><span class="annottext">hoistBuildT :: (forall a. m a -&gt; n a) -&gt; BuildT m b -&gt; BuildT n b
</span><a href="TensorFlow.Build.html#hoistBuildT"><span class="hs-identifier hs-var hs-var">hoistBuildT</span></a></span></span><span> </span><span id="local-6989586621679165386"><span class="annot"><span class="annottext">f :: forall a. m a -&gt; n a
</span><a href="#local-6989586621679165386"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Build.html#BuildT"><span class="hs-identifier hs-type">BuildT</span></a></span><span> </span><span id="local-6989586621679165385"><span class="annot"><span class="annottext">m :: StateT GraphState m b
</span><a href="#local-6989586621679165385"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StateT GraphState n b -&gt; BuildT n b
forall (m :: * -&gt; *) a. StateT GraphState m a -&gt; BuildT m a
</span><a href="TensorFlow.Build.html#BuildT"><span class="hs-identifier hs-var">BuildT</span></a></span><span> </span><span class="annot"><span class="annottext">(StateT GraphState n b -&gt; BuildT n b)
-&gt; StateT GraphState n b -&gt; BuildT n b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">(m (b, GraphState) -&gt; n (b, GraphState))
-&gt; StateT GraphState m b -&gt; StateT GraphState n b
forall (m :: * -&gt; *) a s (n :: * -&gt; *) b.
(m (a, s) -&gt; n (b, s)) -&gt; StateT s m a -&gt; StateT s n b
</span><span class="hs-identifier hs-var">mapStateT</span></span><span> </span><span class="annot"><span class="annottext">m (b, GraphState) -&gt; n (b, GraphState)
forall a. m a -&gt; n a
</span><a href="#local-6989586621679165386"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">StateT GraphState m b
</span><a href="#local-6989586621679165385"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-201"></span><span>
</span><span id="line-202"></span><span id="local-6989586621679165706"><span id="local-6989586621679165707"><span class="annot"><a href="TensorFlow.Build.html#runBuildT"><span class="hs-identifier hs-type">runBuildT</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#BuildT"><span class="hs-identifier hs-type">BuildT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165707"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165706"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679165707"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679165706"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#GraphState"><span class="hs-identifier hs-type">GraphState</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-203"></span><span id="runBuildT"><span class="annot"><span class="annottext">runBuildT :: BuildT m a -&gt; m (a, GraphState)
</span><a href="TensorFlow.Build.html#runBuildT"><span class="hs-identifier hs-var hs-var">runBuildT</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Build.html#BuildT"><span class="hs-identifier hs-type">BuildT</span></a></span><span> </span><span id="local-6989586621679165384"><span class="annot"><span class="annottext">f :: StateT GraphState m a
</span><a href="#local-6989586621679165384"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StateT GraphState m a -&gt; GraphState -&gt; m (a, GraphState)
forall s (m :: * -&gt; *) a. StateT s m a -&gt; s -&gt; m (a, s)
</span><span class="hs-identifier hs-var hs-var">runStateT</span></span><span> </span><span class="annot"><span class="annottext">StateT GraphState m a
</span><a href="#local-6989586621679165384"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">GraphState
</span><a href="TensorFlow.Build.html#initGraphState"><span class="hs-identifier hs-var">initGraphState</span></a></span><span>
</span><span id="line-204"></span><span>
</span><span id="line-205"></span><span id="local-6989586621679165381"><span id="local-6989586621679165382"><span class="annot"><a href="TensorFlow.Build.html#evalBuildT"><span class="hs-identifier hs-type">evalBuildT</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Monad</span></span><span> </span><span class="annot"><a href="#local-6989586621679165382"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#BuildT"><span class="hs-identifier hs-type">BuildT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165382"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165381"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679165382"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165381"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-206"></span><span id="evalBuildT"><span class="annot"><span class="annottext">evalBuildT :: BuildT m a -&gt; m a
</span><a href="TensorFlow.Build.html#evalBuildT"><span class="hs-identifier hs-var hs-var">evalBuildT</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Build.html#BuildT"><span class="hs-identifier hs-type">BuildT</span></a></span><span> </span><span id="local-6989586621679165380"><span class="annot"><span class="annottext">f :: StateT GraphState m a
</span><a href="#local-6989586621679165380"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StateT GraphState m a -&gt; GraphState -&gt; m a
forall (m :: * -&gt; *) s a. Monad m =&gt; StateT s m a -&gt; s -&gt; m a
</span><span class="hs-identifier hs-var">evalStateT</span></span><span> </span><span class="annot"><span class="annottext">StateT GraphState m a
</span><a href="#local-6989586621679165380"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">GraphState
</span><a href="TensorFlow.Build.html#initGraphState"><span class="hs-identifier hs-var">initGraphState</span></a></span><span>
</span><span id="line-207"></span><span>
</span><span id="line-208"></span><span class="hs-comment">-- | Lift a 'Build' action into a monad, including any explicit op renderings.</span><span>
</span><span id="line-209"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Monad</span></span><span> </span><span class="annot"><a href="#local-6989586621679165758"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="MonadBuild"><span class="annot"><a href="TensorFlow.Build.html#MonadBuild"><span class="hs-identifier hs-var">MonadBuild</span></a></span></span><span> </span><span id="local-6989586621679165758"><span class="annot"><a href="#local-6989586621679165758"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-210"></span><span>    </span><span id="local-6989586621679165761"><span id="build"><span class="annot"><a href="TensorFlow.Build.html#build"><span class="hs-identifier hs-type">build</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#Build"><span class="hs-identifier hs-type">Build</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165761"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679165758"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165761"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-211"></span><span>
</span><span id="line-212"></span><span id="local-6989586621679165378"><span class="hs-keyword">instance</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Monad</span></span><span> </span><span class="annot"><a href="#local-6989586621679165378"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#MonadBuild"><span class="hs-identifier hs-type">MonadBuild</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Build.html#BuildT"><span class="hs-identifier hs-type">BuildT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165378"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-213"></span><span>    </span><span id="local-6989586621679165374"><span class="annot"><span class="annottext">build :: Build a -&gt; BuildT m a
</span><a href="#local-6989586621679165374"><span class="hs-identifier hs-var hs-var hs-var hs-var">build</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall a. Identity a -&gt; m a) -&gt; Build a -&gt; BuildT m a
forall (m :: * -&gt; *) (n :: * -&gt; *) b.
(forall a. m a -&gt; n a) -&gt; BuildT m b -&gt; BuildT n b
</span><a href="TensorFlow.Build.html#hoistBuildT"><span class="hs-identifier hs-var">hoistBuildT</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. Identity a -&gt; m a) -&gt; Build a -&gt; BuildT m a)
-&gt; (forall a. Identity a -&gt; m a) -&gt; Build a -&gt; BuildT m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">a -&gt; m a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><span class="hs-identifier hs-var">return</span></span><span> </span><span class="annot"><span class="annottext">(a -&gt; m a) -&gt; (Identity a -&gt; a) -&gt; Identity a -&gt; m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><span class="hs-operator hs-var">.</span></span><span> </span><span class="annot"><span class="annottext">Identity a -&gt; a
forall a. Identity a -&gt; a
</span><span class="hs-identifier hs-var hs-var">runIdentity</span></span></span><span>
</span><span id="line-214"></span><span>
</span><span id="line-215"></span><span class="hs-comment">-- | Get all the NodeDefs that have accumulated so far, and clear that buffer.</span><span>
</span><span id="line-216"></span><span id="local-6989586621679165372"><span class="annot"><a href="TensorFlow.Build.html#flushNodeBuffer"><span class="hs-identifier hs-type">flushNodeBuffer</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#MonadBuild"><span class="hs-identifier hs-type">MonadBuild</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165372"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679165372"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="hs-identifier hs-type">NodeDef</span></span><span class="hs-special">]</span></span><span>
</span><span id="line-217"></span><span id="flushNodeBuffer"><span class="annot"><span class="annottext">flushNodeBuffer :: m [NodeDef]
</span><a href="TensorFlow.Build.html#flushNodeBuffer"><span class="hs-identifier hs-var hs-var">flushNodeBuffer</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Build [NodeDef] -&gt; m [NodeDef]
forall (m :: * -&gt; *) a. MonadBuild m =&gt; Build a -&gt; m a
</span><a href="TensorFlow.Build.html#build"><span class="hs-identifier hs-var">build</span></a></span><span> </span><span class="annot"><span class="annottext">(Build [NodeDef] -&gt; m [NodeDef]) -&gt; Build [NodeDef] -&gt; m [NodeDef]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-218"></span><span>    </span><span id="local-6989586621679165371"><span class="annot"><span class="annottext">[NodeDef]
</span><a href="#local-6989586621679165371"><span class="hs-identifier hs-var">ns</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FoldLike [NodeDef] GraphState GraphState [NodeDef] [NodeDef]
-&gt; Build [NodeDef]
forall s (m :: * -&gt; *) a t b.
MonadState s m =&gt;
FoldLike a s t a b -&gt; m a
</span><span class="hs-identifier hs-var">use</span></span><span> </span><span class="annot"><span class="annottext">FoldLike [NodeDef] GraphState GraphState [NodeDef] [NodeDef]
Lens GraphState GraphState [NodeDef] [NodeDef]
</span><a href="TensorFlow.Build.html#nodeBuffer"><span class="hs-identifier hs-var">nodeBuffer</span></a></span><span>
</span><span id="line-219"></span><span>    </span><span class="annot"><span class="annottext">Lens GraphState GraphState [NodeDef] [NodeDef]
forall (f :: * -&gt; *).
Identical f =&gt;
LensLike' f GraphState [NodeDef]
</span><a href="TensorFlow.Build.html#nodeBuffer"><span class="hs-identifier hs-var">nodeBuffer</span></a></span><span> </span><span class="annot"><span class="annottext">(forall (f :: * -&gt; *).
 Identical f =&gt;
 LensLike' f GraphState [NodeDef])
-&gt; [NodeDef] -&gt; BuildT Identity ()
forall s (m :: * -&gt; *) a b.
MonadState s m =&gt;
Setter s s a b -&gt; b -&gt; m ()
</span><span class="hs-operator hs-var">.=</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-220"></span><span>    </span><span class="annot"><span class="annottext">[NodeDef] -&gt; Build [NodeDef]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><span class="hs-identifier hs-var">return</span></span><span> </span><span class="annot"><span class="annottext">[NodeDef]
</span><a href="#local-6989586621679165371"><span class="hs-identifier hs-var">ns</span></a></span><span>
</span><span id="line-221"></span><span>
</span><span id="line-222"></span><span class="hs-comment">-- | Get all the initializers that have accumulated so far, and clear</span><span>
</span><span id="line-223"></span><span class="hs-comment">-- that buffer.</span><span>
</span><span id="line-224"></span><span id="local-6989586621679165370"><span class="annot"><a href="TensorFlow.Build.html#flushInitializers"><span class="hs-identifier hs-type">flushInitializers</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Monad</span></span><span> </span><span class="annot"><a href="#local-6989586621679165370"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#BuildT"><span class="hs-identifier hs-type">BuildT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165370"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="TensorFlow.Output.html#NodeName"><span class="hs-identifier hs-type">NodeName</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-225"></span><span id="flushInitializers"><span class="annot"><span class="annottext">flushInitializers :: BuildT m [NodeName]
</span><a href="TensorFlow.Build.html#flushInitializers"><span class="hs-identifier hs-var hs-var">flushInitializers</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-226"></span><span>    </span><span id="local-6989586621679165369"><span class="annot"><span class="annottext">[NodeName]
</span><a href="#local-6989586621679165369"><span class="hs-identifier hs-var">ns</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FoldLike [NodeName] GraphState GraphState [NodeName] [NodeName]
-&gt; BuildT m [NodeName]
forall s (m :: * -&gt; *) a t b.
MonadState s m =&gt;
FoldLike a s t a b -&gt; m a
</span><span class="hs-identifier hs-var">use</span></span><span> </span><span class="annot"><span class="annottext">FoldLike [NodeName] GraphState GraphState [NodeName] [NodeName]
Lens GraphState GraphState [NodeName] [NodeName]
</span><a href="TensorFlow.Build.html#initializationNodes"><span class="hs-identifier hs-var">initializationNodes</span></a></span><span>
</span><span id="line-227"></span><span>    </span><span class="annot"><span class="annottext">Lens GraphState GraphState [NodeName] [NodeName]
forall (f :: * -&gt; *).
Identical f =&gt;
LensLike' f GraphState [NodeName]
</span><a href="TensorFlow.Build.html#initializationNodes"><span class="hs-identifier hs-var">initializationNodes</span></a></span><span> </span><span class="annot"><span class="annottext">(forall (f :: * -&gt; *).
 Identical f =&gt;
 LensLike' f GraphState [NodeName])
-&gt; [NodeName] -&gt; BuildT m ()
forall s (m :: * -&gt; *) a b.
MonadState s m =&gt;
Setter s s a b -&gt; b -&gt; m ()
</span><span class="hs-operator hs-var">.=</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-228"></span><span>    </span><span class="annot"><span class="annottext">[NodeName] -&gt; BuildT m [NodeName]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><span class="hs-identifier hs-var">return</span></span><span> </span><span class="annot"><span class="annottext">[NodeName]
</span><a href="#local-6989586621679165369"><span class="hs-identifier hs-var">ns</span></a></span><span>
</span><span id="line-229"></span><span>
</span><span id="line-230"></span><span class="hs-comment">-- | Registers the given node to be executed before the next</span><span>
</span><span id="line-231"></span><span class="hs-comment">-- 'TensorFlow.Session.run'.</span><span>
</span><span id="line-232"></span><span id="local-6989586621679165368"><span class="annot"><a href="TensorFlow.Build.html#addInitializer"><span class="hs-identifier hs-type">addInitializer</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#MonadBuild"><span class="hs-identifier hs-type">MonadBuild</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165368"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Output.html#ControlNode"><span class="hs-identifier hs-type">ControlNode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679165368"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-233"></span><span id="addInitializer"><span class="annot"><span class="annottext">addInitializer :: ControlNode -&gt; m ()
</span><a href="TensorFlow.Build.html#addInitializer"><span class="hs-identifier hs-var hs-var">addInitializer</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Output.html#ControlNode"><span class="hs-identifier hs-type">ControlNode</span></a></span><span> </span><span id="local-6989586621679165366"><span class="annot"><span class="annottext">i :: NodeName
</span><a href="#local-6989586621679165366"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BuildT Identity () -&gt; m ()
forall (m :: * -&gt; *) a. MonadBuild m =&gt; Build a -&gt; m a
</span><a href="TensorFlow.Build.html#build"><span class="hs-identifier hs-var">build</span></a></span><span> </span><span class="annot"><span class="annottext">(BuildT Identity () -&gt; m ()) -&gt; BuildT Identity () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">Lens GraphState GraphState [NodeName] [NodeName]
forall (f :: * -&gt; *).
Identical f =&gt;
LensLike' f GraphState [NodeName]
</span><a href="TensorFlow.Build.html#initializationNodes"><span class="hs-identifier hs-var">initializationNodes</span></a></span><span> </span><span class="annot"><span class="annottext">(forall (f :: * -&gt; *).
 Identical f =&gt;
 LensLike' f GraphState [NodeName])
-&gt; ([NodeName] -&gt; [NodeName]) -&gt; BuildT Identity ()
forall s (m :: * -&gt; *) a b.
MonadState s m =&gt;
Setter s s a b -&gt; (a -&gt; b) -&gt; m ()
</span><span class="hs-operator hs-var">%=</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NodeName
</span><a href="#local-6989586621679165366"><span class="hs-identifier hs-var">i</span></a></span><span class="annot"><span class="annottext">NodeName -&gt; [NodeName] -&gt; [NodeName]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="hs-special">)</span><span>
</span><span id="line-234"></span><span>
</span><span id="line-235"></span><span class="hs-comment">-- | Produce a GraphDef proto representation of the nodes that are rendered in</span><span>
</span><span id="line-236"></span><span class="hs-comment">-- the given 'Build' action.</span><span>
</span><span id="line-237"></span><span id="local-6989586621679165365"><span class="annot"><a href="TensorFlow.Build.html#asGraphDef"><span class="hs-identifier hs-type">asGraphDef</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#Build"><span class="hs-identifier hs-type">Build</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165365"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">GraphDef</span></span></span><span>
</span><span id="line-238"></span><span id="asGraphDef"><span class="annot"><span class="annottext">asGraphDef :: Build a -&gt; GraphDef
</span><a href="TensorFlow.Build.html#asGraphDef"><span class="hs-identifier hs-var hs-var">asGraphDef</span></a></span></span><span> </span><span id="local-6989586621679165364"><span class="annot"><span class="annottext">b :: Build a
</span><a href="#local-6989586621679165364"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GraphDef
forall msg. Message msg =&gt; msg
</span><span class="hs-identifier hs-var">defMessage</span></span><span> </span><span class="annot"><span class="annottext">GraphDef -&gt; (GraphDef -&gt; GraphDef) -&gt; GraphDef
forall s t. s -&gt; (s -&gt; t) -&gt; t
</span><span class="hs-operator hs-var">&amp;</span></span><span> </span><span class="annot"><span class="annottext">forall (f :: * -&gt; *). Identical f =&gt; LensLike' f GraphDef [NodeDef]
forall (f :: * -&gt; *) s a.
(Functor f, HasField s &quot;node&quot; a) =&gt;
LensLike' f s a
</span><span class="hs-identifier hs-var">node</span></span><span> </span><span class="annot"><span class="annottext">(forall (f :: * -&gt; *).
 Identical f =&gt;
 LensLike' f GraphDef [NodeDef])
-&gt; [NodeDef] -&gt; GraphDef -&gt; GraphDef
forall s t a b. Setter s t a b -&gt; b -&gt; s -&gt; t
</span><span class="hs-operator hs-var">.~</span></span><span> </span><span class="annot"><span class="annottext">GraphState
</span><a href="#local-6989586621679165363"><span class="hs-identifier hs-var">gs</span></a></span><span> </span><span class="annot"><span class="annottext">GraphState
-&gt; FoldLike [NodeDef] GraphState GraphState [NodeDef] [NodeDef]
-&gt; [NodeDef]
forall s a t b. s -&gt; FoldLike a s t a b -&gt; a
</span><span class="hs-operator hs-var">^.</span></span><span> </span><span class="annot"><span class="annottext">FoldLike [NodeDef] GraphState GraphState [NodeDef] [NodeDef]
Lens GraphState GraphState [NodeDef] [NodeDef]
</span><a href="TensorFlow.Build.html#nodeBuffer"><span class="hs-identifier hs-var">nodeBuffer</span></a></span><span>
</span><span id="line-239"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-240"></span><span>    </span><span id="local-6989586621679165363"><span class="annot"><span class="annottext">gs :: GraphState
</span><a href="#local-6989586621679165363"><span class="hs-identifier hs-var hs-var">gs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a, GraphState) -&gt; GraphState
forall a b. (a, b) -&gt; b
</span><span class="hs-identifier hs-var">snd</span></span><span> </span><span class="annot"><span class="annottext">((a, GraphState) -&gt; GraphState) -&gt; (a, GraphState) -&gt; GraphState
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">Identity (a, GraphState) -&gt; (a, GraphState)
forall a. Identity a -&gt; a
</span><span class="hs-identifier hs-var hs-var">runIdentity</span></span><span> </span><span class="annot"><span class="annottext">(Identity (a, GraphState) -&gt; (a, GraphState))
-&gt; Identity (a, GraphState) -&gt; (a, GraphState)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">Build a -&gt; Identity (a, GraphState)
forall (m :: * -&gt; *) a. BuildT m a -&gt; m (a, GraphState)
</span><a href="TensorFlow.Build.html#runBuildT"><span class="hs-identifier hs-var">runBuildT</span></a></span><span> </span><span class="annot"><span class="annottext">Build a
</span><a href="#local-6989586621679165364"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-241"></span><span>
</span><span id="line-242"></span><span class="hs-comment">-- TODO: check against existing nodes for conflicts?</span><span>
</span><span id="line-243"></span><span id="local-6989586621679165362"><span class="annot"><a href="TensorFlow.Build.html#addGraphDef"><span class="hs-identifier hs-type">addGraphDef</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#MonadBuild"><span class="hs-identifier hs-type">MonadBuild</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165362"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">GraphDef</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679165362"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-244"></span><span id="addGraphDef"><span class="annot"><span class="annottext">addGraphDef :: GraphDef -&gt; m ()
</span><a href="TensorFlow.Build.html#addGraphDef"><span class="hs-identifier hs-var hs-var">addGraphDef</span></a></span></span><span> </span><span id="local-6989586621679165361"><span class="annot"><span class="annottext">g :: GraphDef
</span><a href="#local-6989586621679165361"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BuildT Identity () -&gt; m ()
forall (m :: * -&gt; *) a. MonadBuild m =&gt; Build a -&gt; m a
</span><a href="TensorFlow.Build.html#build"><span class="hs-identifier hs-var">build</span></a></span><span> </span><span class="annot"><span class="annottext">(BuildT Identity () -&gt; m ()) -&gt; BuildT Identity () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">Lens GraphState GraphState [NodeDef] [NodeDef]
forall (f :: * -&gt; *).
Identical f =&gt;
LensLike' f GraphState [NodeDef]
</span><a href="TensorFlow.Build.html#nodeBuffer"><span class="hs-identifier hs-var">nodeBuffer</span></a></span><span> </span><span class="annot"><span class="annottext">(forall (f :: * -&gt; *).
 Identical f =&gt;
 LensLike' f GraphState [NodeDef])
-&gt; [NodeDef] -&gt; BuildT Identity ()
forall s (m :: * -&gt; *) a.
(MonadState s m, Monoid a) =&gt;
Setter' s a -&gt; a -&gt; m ()
</span><span class="hs-operator hs-var">&lt;&gt;=</span></span><span> </span><span class="annot"><span class="annottext">GraphDef
</span><a href="#local-6989586621679165361"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">GraphDef
-&gt; FoldLike [NodeDef] GraphDef GraphDef [NodeDef] [NodeDef]
-&gt; [NodeDef]
forall s a t b. s -&gt; FoldLike a s t a b -&gt; a
</span><span class="hs-operator hs-var">^.</span></span><span> </span><span class="annot"><span class="annottext">FoldLike [NodeDef] GraphDef GraphDef [NodeDef] [NodeDef]
forall (f :: * -&gt; *) s a.
(Functor f, HasField s &quot;node&quot; a) =&gt;
LensLike' f s a
</span><span class="hs-identifier hs-var">node</span></span><span>
</span><span id="line-245"></span><span>
</span><span id="line-246"></span><span class="hs-comment">-- | Render the given op if it hasn't been rendered already, and return its</span><span>
</span><span id="line-247"></span><span class="hs-comment">-- name.</span><span>
</span><span id="line-248"></span><span class="annot"><a href="TensorFlow.Build.html#getOrAddOp"><span class="hs-identifier hs-type">getOrAddOp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Output.html#OpDef"><span class="hs-identifier hs-type">OpDef</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#Build"><span class="hs-identifier hs-type">Build</span></a></span><span> </span><span class="annot"><a href="TensorFlow.Output.html#NodeName"><span class="hs-identifier hs-type">NodeName</span></a></span><span>
</span><span id="line-249"></span><span id="getOrAddOp"><span class="annot"><span class="annottext">getOrAddOp :: OpDef -&gt; Build NodeName
</span><a href="TensorFlow.Build.html#getOrAddOp"><span class="hs-identifier hs-var hs-var">getOrAddOp</span></a></span></span><span> </span><span id="local-6989586621679165360"><span class="annot"><span class="annottext">o :: OpDef
</span><a href="#local-6989586621679165360"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-250"></span><span>    </span><span id="local-6989586621679165359"><span class="annot"><span class="annottext">PendingNode
</span><a href="#local-6989586621679165359"><span class="hs-identifier hs-var">pending</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">OpDef -&gt; Build PendingNode
</span><a href="TensorFlow.Build.html#getPendingNode"><span class="hs-identifier hs-var">getPendingNode</span></a></span><span> </span><span class="annot"><span class="annottext">OpDef
</span><a href="#local-6989586621679165360"><span class="hs-identifier hs-var">o</span></a></span><span>
</span><span id="line-251"></span><span>    </span><span class="annot"><span class="annottext">FoldLike
  (Maybe NodeDef)
  GraphState
  GraphState
  (Map PendingNode NodeDef)
  (Map PendingNode NodeDef)
-&gt; (Map PendingNode NodeDef -&gt; Maybe NodeDef)
-&gt; BuildT Identity (Maybe NodeDef)
forall s (m :: * -&gt; *) r t a b.
MonadState s m =&gt;
FoldLike r s t a b -&gt; (a -&gt; r) -&gt; m r
</span><span class="hs-identifier hs-var">uses</span></span><span> </span><span class="annot"><span class="annottext">FoldLike
  (Maybe NodeDef)
  GraphState
  GraphState
  (Map PendingNode NodeDef)
  (Map PendingNode NodeDef)
Lens
  GraphState
  GraphState
  (Map PendingNode NodeDef)
  (Map PendingNode NodeDef)
</span><a href="TensorFlow.Build.html#renderedNodes"><span class="hs-identifier hs-var">renderedNodes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PendingNode -&gt; Map PendingNode NodeDef -&gt; Maybe NodeDef
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><span class="hs-identifier hs-var">Map.lookup</span></span><span> </span><span class="annot"><span class="annottext">PendingNode
</span><a href="#local-6989586621679165359"><span class="hs-identifier hs-var">pending</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">BuildT Identity (Maybe NodeDef)
-&gt; (Maybe NodeDef -&gt; Build NodeName) -&gt; Build NodeName
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><span class="hs-operator hs-var">&gt;&gt;=</span></span><span> </span><span class="hs-glyph">\</span><span class="hs-glyph">case</span><span>
</span><span id="line-252"></span><span>        </span><span class="annot"><span class="hs-identifier hs-type">Just</span></span><span> </span><span id="local-6989586621679165356"><span class="annot"><span class="annottext">n :: NodeDef
</span><a href="#local-6989586621679165356"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NodeName -&gt; Build NodeName
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><span class="hs-identifier hs-var">return</span></span><span> </span><span class="annot"><span class="annottext">(NodeName -&gt; Build NodeName) -&gt; NodeName -&gt; Build NodeName
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">Text -&gt; NodeName
</span><a href="TensorFlow.Output.html#NodeName"><span class="hs-identifier hs-var">NodeName</span></a></span><span> </span><span class="annot"><span class="annottext">(Text -&gt; NodeName) -&gt; Text -&gt; NodeName
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">NodeDef
</span><a href="#local-6989586621679165356"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">NodeDef -&gt; FoldLike Text NodeDef NodeDef Text Text -&gt; Text
forall s a t b. s -&gt; FoldLike a s t a b -&gt; a
</span><span class="hs-operator hs-var">^.</span></span><span> </span><span class="annot"><span class="annottext">FoldLike Text NodeDef NodeDef Text Text
forall (f :: * -&gt; *) s a.
(Functor f, HasField s &quot;name&quot; a) =&gt;
LensLike' f s a
</span><span class="hs-identifier hs-var">name</span></span><span>
</span><span id="line-253"></span><span>        </span><span class="annot"><span class="hs-identifier hs-type">Nothing</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">PendingNode -&gt; Build NodeName
</span><a href="TensorFlow.Build.html#addNewOpFromPending"><span class="hs-identifier hs-var">addNewOpFromPending</span></a></span><span> </span><span class="annot"><span class="annottext">PendingNode
</span><a href="#local-6989586621679165359"><span class="hs-identifier hs-var">pending</span></a></span><span>
</span><span id="line-254"></span><span>
</span><span id="line-255"></span><span class="annot"><a href="TensorFlow.Build.html#lookupNode"><span class="hs-identifier hs-type">lookupNode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Output.html#NodeName"><span class="hs-identifier hs-type">NodeName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#Build"><span class="hs-identifier hs-type">Build</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">NodeDef</span></span><span>
</span><span id="line-256"></span><span id="lookupNode"><span class="annot"><span class="annottext">lookupNode :: NodeName -&gt; Build NodeDef
</span><a href="TensorFlow.Build.html#lookupNode"><span class="hs-identifier hs-var hs-var">lookupNode</span></a></span></span><span> </span><span id="local-6989586621679165353"><span class="annot"><span class="annottext">n :: NodeName
</span><a href="#local-6989586621679165353"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FoldLike
  (Maybe NodeDef)
  GraphState
  GraphState
  (Map NodeName NodeDef)
  (Map NodeName NodeDef)
-&gt; (Map NodeName NodeDef -&gt; Maybe NodeDef)
-&gt; BuildT Identity (Maybe NodeDef)
forall s (m :: * -&gt; *) r t a b.
MonadState s m =&gt;
FoldLike r s t a b -&gt; (a -&gt; r) -&gt; m r
</span><span class="hs-identifier hs-var">uses</span></span><span> </span><span class="annot"><span class="annottext">FoldLike
  (Maybe NodeDef)
  GraphState
  GraphState
  (Map NodeName NodeDef)
  (Map NodeName NodeDef)
Lens
  GraphState GraphState (Map NodeName NodeDef) (Map NodeName NodeDef)
</span><a href="TensorFlow.Build.html#renderedNodeDefs"><span class="hs-identifier hs-var">renderedNodeDefs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NodeName -&gt; Map NodeName NodeDef -&gt; Maybe NodeDef
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><span class="hs-identifier hs-var">Map.lookup</span></span><span> </span><span class="annot"><span class="annottext">NodeName
</span><a href="#local-6989586621679165353"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">BuildT Identity (Maybe NodeDef)
-&gt; (Maybe NodeDef -&gt; Build NodeDef) -&gt; Build NodeDef
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><span class="hs-operator hs-var">&gt;&gt;=</span></span><span> </span><span class="hs-glyph">\</span><span class="hs-glyph">case</span><span>
</span><span id="line-257"></span><span>    </span><span class="annot"><span class="hs-identifier hs-type">Just</span></span><span> </span><span id="local-6989586621679165352"><span class="annot"><span class="annottext">n' :: NodeDef
</span><a href="#local-6989586621679165352"><span class="hs-identifier hs-var">n'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NodeDef -&gt; Build NodeDef
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><span class="hs-identifier hs-var">return</span></span><span> </span><span class="annot"><span class="annottext">NodeDef
</span><a href="#local-6989586621679165352"><span class="hs-identifier hs-var">n'</span></a></span><span>
</span><span id="line-258"></span><span>    </span><span class="annot"><span class="hs-identifier hs-type">Nothing</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Build NodeDef
forall a. HasCallStack =&gt; String -&gt; a
</span><span class="hs-identifier hs-var">error</span></span><span> </span><span class="annot"><span class="annottext">(String -&gt; Build NodeDef) -&gt; String -&gt; Build NodeDef
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="hs-string">&quot;lookupNode: unknown node name &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><span class="hs-operator hs-var">++</span></span><span> </span><span class="annot"><span class="annottext">NodeName -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><span class="hs-identifier hs-var">show</span></span><span> </span><span class="annot"><span class="annottext">NodeName
</span><a href="#local-6989586621679165353"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-259"></span><span>
</span><span id="line-260"></span><span class="hs-comment">-- | Add a new node for a given 'OpDef'.  This is used for making &quot;stateful&quot; ops</span><span>
</span><span id="line-261"></span><span class="hs-comment">-- which are not safe to dedup (e.g, &quot;variable&quot; and &quot;assign&quot;).</span><span>
</span><span id="line-262"></span><span class="annot"><a href="TensorFlow.Build.html#addNewOp"><span class="hs-identifier hs-type">addNewOp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Output.html#OpDef"><span class="hs-identifier hs-type">OpDef</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#Build"><span class="hs-identifier hs-type">Build</span></a></span><span> </span><span class="annot"><a href="TensorFlow.Output.html#NodeName"><span class="hs-identifier hs-type">NodeName</span></a></span><span>
</span><span id="line-263"></span><span id="addNewOp"><span class="annot"><span class="annottext">addNewOp :: OpDef -&gt; Build NodeName
</span><a href="TensorFlow.Build.html#addNewOp"><span class="hs-identifier hs-var hs-var">addNewOp</span></a></span></span><span> </span><span id="local-6989586621679165350"><span class="annot"><span class="annottext">o :: OpDef
</span><a href="#local-6989586621679165350"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OpDef -&gt; Build PendingNode
</span><a href="TensorFlow.Build.html#getPendingNode"><span class="hs-identifier hs-var">getPendingNode</span></a></span><span> </span><span class="annot"><span class="annottext">OpDef
</span><a href="#local-6989586621679165350"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="annot"><span class="annottext">Build PendingNode
-&gt; (PendingNode -&gt; Build NodeName) -&gt; Build NodeName
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><span class="hs-operator hs-var">&gt;&gt;=</span></span><span> </span><span class="annot"><span class="annottext">PendingNode -&gt; Build NodeName
</span><a href="TensorFlow.Build.html#addNewOpFromPending"><span class="hs-identifier hs-var">addNewOpFromPending</span></a></span><span>
</span><span id="line-264"></span><span>
</span><span id="line-265"></span><span class="annot"><a href="TensorFlow.Build.html#addNewOpFromPending"><span class="hs-identifier hs-type">addNewOpFromPending</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#PendingNode"><span class="hs-identifier hs-type">PendingNode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#Build"><span class="hs-identifier hs-type">Build</span></a></span><span> </span><span class="annot"><a href="TensorFlow.Output.html#NodeName"><span class="hs-identifier hs-type">NodeName</span></a></span><span>
</span><span id="line-266"></span><span id="addNewOpFromPending"><span class="annot"><span class="annottext">addNewOpFromPending :: PendingNode -&gt; Build NodeName
</span><a href="TensorFlow.Build.html#addNewOpFromPending"><span class="hs-identifier hs-var hs-var">addNewOpFromPending</span></a></span></span><span> </span><span id="local-6989586621679165349"><span class="annot"><span class="annottext">pending :: PendingNode
</span><a href="#local-6989586621679165349"><span class="hs-identifier hs-var">pending</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-267"></span><span>    </span><span id="local-6989586621679165348"><span class="annot"><span class="annottext">NodeName
</span><a href="#local-6989586621679165348"><span class="hs-identifier hs-var">nodeName</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">PendingNode -&gt; Build NodeName
</span><a href="TensorFlow.Build.html#renderPendingNode"><span class="hs-identifier hs-var">renderPendingNode</span></a></span><span> </span><span class="annot"><span class="annottext">PendingNode
</span><a href="#local-6989586621679165349"><span class="hs-identifier hs-var">pending</span></a></span><span>
</span><span id="line-268"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679165346"><span class="annot"><span class="annottext">nodeDef :: NodeDef
</span><a href="#local-6989586621679165346"><span class="hs-identifier hs-var hs-var">nodeDef</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PendingNode -&gt; NodeDef
</span><a href="TensorFlow.Build.html#pendingNodeDef"><span class="hs-identifier hs-var">pendingNodeDef</span></a></span><span> </span><span class="annot"><span class="annottext">PendingNode
</span><a href="#local-6989586621679165349"><span class="hs-identifier hs-var">pending</span></a></span><span> </span><span class="annot"><span class="annottext">NodeDef -&gt; (NodeDef -&gt; NodeDef) -&gt; NodeDef
forall s t. s -&gt; (s -&gt; t) -&gt; t
</span><span class="hs-operator hs-var">&amp;</span></span><span> </span><span class="annot"><span class="annottext">forall (f :: * -&gt; *). Identical f =&gt; LensLike' f NodeDef Text
forall (f :: * -&gt; *) s a.
(Functor f, HasField s &quot;name&quot; a) =&gt;
LensLike' f s a
</span><span class="hs-identifier hs-var">name</span></span><span> </span><span class="annot"><span class="annottext">(forall (f :: * -&gt; *). Identical f =&gt; LensLike' f NodeDef Text)
-&gt; Text -&gt; NodeDef -&gt; NodeDef
forall s t a b. Setter s t a b -&gt; b -&gt; s -&gt; t
</span><span class="hs-operator hs-var">.~</span></span><span> </span><span class="annot"><span class="annottext">NodeName -&gt; Text
</span><a href="TensorFlow.Output.html#unNodeName"><span class="hs-identifier hs-var hs-var">unNodeName</span></a></span><span> </span><span class="annot"><span class="annottext">NodeName
</span><a href="#local-6989586621679165348"><span class="hs-identifier hs-var">nodeName</span></a></span><span>
</span><span id="line-269"></span><span>    </span><span class="annot"><span class="annottext">Lens GraphState GraphState [NodeDef] [NodeDef]
forall (f :: * -&gt; *).
Identical f =&gt;
LensLike' f GraphState [NodeDef]
</span><a href="TensorFlow.Build.html#nodeBuffer"><span class="hs-identifier hs-var">nodeBuffer</span></a></span><span> </span><span class="annot"><span class="annottext">(forall (f :: * -&gt; *).
 Identical f =&gt;
 LensLike' f GraphState [NodeDef])
-&gt; ([NodeDef] -&gt; [NodeDef]) -&gt; BuildT Identity ()
forall s (m :: * -&gt; *) a b.
MonadState s m =&gt;
Setter s s a b -&gt; (a -&gt; b) -&gt; m ()
</span><span class="hs-operator hs-var">%=</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NodeDef
</span><a href="#local-6989586621679165346"><span class="hs-identifier hs-var">nodeDef</span></a></span><span> </span><span class="annot"><span class="annottext">NodeDef -&gt; [NodeDef] -&gt; [NodeDef]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="hs-special">)</span><span>
</span><span id="line-270"></span><span>    </span><span class="annot"><span class="annottext">Lens
  GraphState
  GraphState
  (Map PendingNode NodeDef)
  (Map PendingNode NodeDef)
forall (f :: * -&gt; *).
Identical f =&gt;
LensLike' f GraphState (Map PendingNode NodeDef)
</span><a href="TensorFlow.Build.html#renderedNodes"><span class="hs-identifier hs-var">renderedNodes</span></a></span><span> </span><span class="annot"><span class="annottext">(forall (f :: * -&gt; *).
 Identical f =&gt;
 LensLike' f GraphState (Map PendingNode NodeDef))
-&gt; (Map PendingNode NodeDef -&gt; Map PendingNode NodeDef)
-&gt; BuildT Identity ()
forall s (m :: * -&gt; *) a b.
MonadState s m =&gt;
Setter s s a b -&gt; (a -&gt; b) -&gt; m ()
</span><span class="hs-operator hs-var">%=</span></span><span> </span><span class="annot"><span class="annottext">PendingNode
-&gt; NodeDef -&gt; Map PendingNode NodeDef -&gt; Map PendingNode NodeDef
forall k a. Ord k =&gt; k -&gt; a -&gt; Map k a -&gt; Map k a
</span><span class="hs-identifier hs-var">Map.insert</span></span><span> </span><span class="annot"><span class="annottext">PendingNode
</span><a href="#local-6989586621679165349"><span class="hs-identifier hs-var">pending</span></a></span><span> </span><span class="annot"><span class="annottext">NodeDef
</span><a href="#local-6989586621679165346"><span class="hs-identifier hs-var">nodeDef</span></a></span><span>
</span><span id="line-271"></span><span>    </span><span class="annot"><span class="annottext">Lens
  GraphState GraphState (Map NodeName NodeDef) (Map NodeName NodeDef)
forall (f :: * -&gt; *).
Identical f =&gt;
LensLike' f GraphState (Map NodeName NodeDef)
</span><a href="TensorFlow.Build.html#renderedNodeDefs"><span class="hs-identifier hs-var">renderedNodeDefs</span></a></span><span> </span><span class="annot"><span class="annottext">(forall (f :: * -&gt; *).
 Identical f =&gt;
 LensLike' f GraphState (Map NodeName NodeDef))
-&gt; (Map NodeName NodeDef -&gt; Map NodeName NodeDef)
-&gt; BuildT Identity ()
forall s (m :: * -&gt; *) a b.
MonadState s m =&gt;
Setter s s a b -&gt; (a -&gt; b) -&gt; m ()
</span><span class="hs-operator hs-var">%=</span></span><span> </span><span class="annot"><span class="annottext">NodeName -&gt; NodeDef -&gt; Map NodeName NodeDef -&gt; Map NodeName NodeDef
forall k a. Ord k =&gt; k -&gt; a -&gt; Map k a -&gt; Map k a
</span><span class="hs-identifier hs-var">Map.insert</span></span><span> </span><span class="annot"><span class="annottext">NodeName
</span><a href="#local-6989586621679165348"><span class="hs-identifier hs-var">nodeName</span></a></span><span> </span><span class="annot"><span class="annottext">NodeDef
</span><a href="#local-6989586621679165346"><span class="hs-identifier hs-var">nodeDef</span></a></span><span>
</span><span id="line-272"></span><span>    </span><span class="annot"><span class="annottext">NodeName -&gt; Build NodeName
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><span class="hs-identifier hs-var">return</span></span><span> </span><span class="annot"><span class="annottext">NodeName
</span><a href="#local-6989586621679165348"><span class="hs-identifier hs-var">nodeName</span></a></span><span>
</span><span id="line-273"></span><span>
</span><span id="line-274"></span><span class="hs-comment">-- | Get the pending node corresponding to an OpDef, which may or may not have</span><span>
</span><span id="line-275"></span><span class="hs-comment">-- been rendered before.  Implicitly renders all of this node's inputs.</span><span>
</span><span id="line-276"></span><span class="annot"><a href="TensorFlow.Build.html#getPendingNode"><span class="hs-identifier hs-type">getPendingNode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Output.html#OpDef"><span class="hs-identifier hs-type">OpDef</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#Build"><span class="hs-identifier hs-type">Build</span></a></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#PendingNode"><span class="hs-identifier hs-type">PendingNode</span></a></span><span>
</span><span id="line-277"></span><span id="getPendingNode"><span class="annot"><span class="annottext">getPendingNode :: OpDef -&gt; Build PendingNode
</span><a href="TensorFlow.Build.html#getPendingNode"><span class="hs-identifier hs-var hs-var">getPendingNode</span></a></span></span><span> </span><span id="local-6989586621679165343"><span class="annot"><span class="annottext">o :: OpDef
</span><a href="#local-6989586621679165343"><span class="hs-identifier hs-var">o</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-278"></span><span>    </span><span class="hs-comment">-- An empty string in the proto field means that no specific</span><span>
</span><span id="line-279"></span><span>    </span><span class="hs-comment">-- device is specified.</span><span>
</span><span id="line-280"></span><span>    </span><span id="local-6989586621679165342"><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679165342"><span class="hs-identifier hs-var">dev</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Text -&gt; (Device -&gt; Text) -&gt; Maybe Device -&gt; Text
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><span class="hs-identifier hs-var">maybe</span></span><span> </span><span class="annot"><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="annot"><span class="annottext">Device -&gt; Text
</span><a href="TensorFlow.Output.html#deviceName"><span class="hs-identifier hs-var hs-var">deviceName</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe Device -&gt; Text)
-&gt; BuildT Identity (Maybe Device) -&gt; BuildT Identity Text
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><span class="hs-operator hs-var">&lt;$&gt;</span></span><span> </span><span class="annot"><span class="annottext">FoldLike
  (Maybe Device) GraphState GraphState (Maybe Device) (Maybe Device)
-&gt; BuildT Identity (Maybe Device)
forall s (m :: * -&gt; *) a t b.
MonadState s m =&gt;
FoldLike a s t a b -&gt; m a
</span><span class="hs-identifier hs-var">use</span></span><span> </span><span class="annot"><span class="annottext">FoldLike
  (Maybe Device) GraphState GraphState (Maybe Device) (Maybe Device)
Lens GraphState GraphState (Maybe Device) (Maybe Device)
</span><a href="TensorFlow.Build.html#defaultDevice"><span class="hs-identifier hs-var">defaultDevice</span></a></span><span>
</span><span id="line-281"></span><span>    </span><span id="local-6989586621679165338"><span class="annot"><span class="annottext">[Scope]
</span><a href="#local-6989586621679165338"><span class="hs-identifier hs-var">scope</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FoldLike [Scope] GraphState GraphState [Scope] [Scope]
-&gt; BuildT Identity [Scope]
forall s (m :: * -&gt; *) a t b.
MonadState s m =&gt;
FoldLike a s t a b -&gt; m a
</span><span class="hs-identifier hs-var">use</span></span><span> </span><span class="annot"><span class="annottext">FoldLike [Scope] GraphState GraphState [Scope] [Scope]
Lens GraphState GraphState [Scope] [Scope]
</span><a href="TensorFlow.Build.html#currentScope"><span class="hs-identifier hs-var">currentScope</span></a></span><span>
</span><span id="line-282"></span><span>    </span><span id="local-6989586621679165337"><span class="annot"><span class="annottext">Set NodeName
</span><a href="#local-6989586621679165337"><span class="hs-identifier hs-var">controls</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FoldLike
  (Set NodeName) GraphState GraphState (Set NodeName) (Set NodeName)
-&gt; BuildT Identity (Set NodeName)
forall s (m :: * -&gt; *) a t b.
MonadState s m =&gt;
FoldLike a s t a b -&gt; m a
</span><span class="hs-identifier hs-var">use</span></span><span> </span><span class="annot"><span class="annottext">FoldLike
  (Set NodeName) GraphState GraphState (Set NodeName) (Set NodeName)
Lens GraphState GraphState (Set NodeName) (Set NodeName)
</span><a href="TensorFlow.Build.html#defaultControlInputs"><span class="hs-identifier hs-var">defaultControlInputs</span></a></span><span>
</span><span id="line-283"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679165336"><span class="annot"><span class="annottext">inputs :: [Text]
</span><a href="#local-6989586621679165336"><span class="hs-identifier hs-var hs-var">inputs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Output -&gt; Text) -&gt; [Output] -&gt; [Text]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><span class="hs-identifier hs-var">map</span></span><span> </span><span class="annot"><span class="annottext">Output -&gt; Text
</span><a href="TensorFlow.Build.html#encodeOutput"><span class="hs-identifier hs-var">encodeOutput</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OpDef
</span><a href="#local-6989586621679165343"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="annot"><span class="annottext">OpDef
-&gt; FoldLike [Output] OpDef OpDef [Output] [Output] -&gt; [Output]
forall s a t b. s -&gt; FoldLike a s t a b -&gt; a
</span><span class="hs-operator hs-var">^.</span></span><span> </span><span class="annot"><span class="annottext">FoldLike [Output] OpDef OpDef [Output] [Output]
Lens' OpDef [Output]
</span><a href="TensorFlow.Output.html#opInputs"><span class="hs-identifier hs-var">opInputs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-284"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679165335"><span class="annot"><span class="annottext">controlInputs :: [Text]
</span><a href="#local-6989586621679165335"><span class="hs-identifier hs-var hs-var">controlInputs</span></a></span></span><span>
</span><span id="line-285"></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(NodeName -&gt; Text) -&gt; [NodeName] -&gt; [Text]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><span class="hs-identifier hs-var">map</span></span><span> </span><span class="annot"><span class="annottext">NodeName -&gt; Text
</span><a href="#local-6989586621679165334"><span class="hs-identifier hs-var">makeDep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OpDef
</span><a href="#local-6989586621679165343"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="annot"><span class="annottext">OpDef
-&gt; FoldLike [NodeName] OpDef OpDef [NodeName] [NodeName]
-&gt; [NodeName]
forall s a t b. s -&gt; FoldLike a s t a b -&gt; a
</span><span class="hs-operator hs-var">^.</span></span><span> </span><span class="annot"><span class="annottext">FoldLike [NodeName] OpDef OpDef [NodeName] [NodeName]
Lens' OpDef [NodeName]
</span><a href="TensorFlow.Output.html#opControlInputs"><span class="hs-identifier hs-var">opControlInputs</span></a></span><span> </span><span class="annot"><span class="annottext">[NodeName] -&gt; [NodeName] -&gt; [NodeName]
forall a. [a] -&gt; [a] -&gt; [a]
</span><span class="hs-operator hs-var">++</span></span><span> </span><span class="annot"><span class="annottext">Set NodeName -&gt; [NodeName]
forall a. Set a -&gt; [a]
</span><span class="hs-identifier hs-var">Set.toList</span></span><span> </span><span class="annot"><span class="annottext">Set NodeName
</span><a href="#local-6989586621679165337"><span class="hs-identifier hs-var">controls</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-286"></span><span>    </span><span class="annot"><span class="annottext">PendingNode -&gt; Build PendingNode
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><span class="hs-identifier hs-var">return</span></span><span> </span><span class="annot"><span class="annottext">(PendingNode -&gt; Build PendingNode)
-&gt; PendingNode -&gt; Build PendingNode
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">[Scope] -&gt; PendingNodeName -&gt; NodeDef -&gt; PendingNode
</span><a href="TensorFlow.Build.html#PendingNode"><span class="hs-identifier hs-var">PendingNode</span></a></span><span> </span><span class="annot"><span class="annottext">[Scope]
</span><a href="#local-6989586621679165338"><span class="hs-identifier hs-var">scope</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OpDef
</span><a href="#local-6989586621679165343"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="annot"><span class="annottext">OpDef
-&gt; FoldLike
     PendingNodeName OpDef OpDef PendingNodeName PendingNodeName
-&gt; PendingNodeName
forall s a t b. s -&gt; FoldLike a s t a b -&gt; a
</span><span class="hs-operator hs-var">^.</span></span><span> </span><span class="annot"><span class="annottext">FoldLike
  PendingNodeName OpDef OpDef PendingNodeName PendingNodeName
Lens' OpDef PendingNodeName
</span><a href="TensorFlow.Output.html#opName"><span class="hs-identifier hs-var">opName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-287"></span><span>            </span><span class="annot"><span class="annottext">(NodeDef -&gt; PendingNode) -&gt; NodeDef -&gt; PendingNode
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">NodeDef
forall msg. Message msg =&gt; msg
</span><span class="hs-identifier hs-var">defMessage</span></span><span> </span><span class="annot"><span class="annottext">NodeDef -&gt; (NodeDef -&gt; NodeDef) -&gt; NodeDef
forall s t. s -&gt; (s -&gt; t) -&gt; t
</span><span class="hs-operator hs-var">&amp;</span></span><span> </span><span class="annot"><span class="annottext">forall (f :: * -&gt; *). Identical f =&gt; LensLike' f NodeDef Text
forall (f :: * -&gt; *) s a.
(Functor f, HasField s &quot;op&quot; a) =&gt;
LensLike' f s a
</span><span class="hs-identifier hs-var">op</span></span><span> </span><span class="annot"><span class="annottext">(forall (f :: * -&gt; *). Identical f =&gt; LensLike' f NodeDef Text)
-&gt; Text -&gt; NodeDef -&gt; NodeDef
forall s t a b. Setter s t a b -&gt; b -&gt; s -&gt; t
</span><span class="hs-operator hs-var">.~</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OpType -&gt; Text
</span><a href="TensorFlow.Output.html#unOpType"><span class="hs-identifier hs-var hs-var">unOpType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OpDef
</span><a href="#local-6989586621679165343"><span class="hs-identifier hs-var">o</span></a></span><span> </span><span class="annot"><span class="annottext">OpDef -&gt; FoldLike OpType OpDef OpDef OpType OpType -&gt; OpType
forall s a t b. s -&gt; FoldLike a s t a b -&gt; a
</span><span class="hs-operator hs-var">^.</span></span><span> </span><span class="annot"><span class="annottext">FoldLike OpType OpDef OpDef OpType OpType
Lens' OpDef OpType
</span><a href="TensorFlow.Output.html#opType"><span class="hs-identifier hs-var">opType</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Text</span></span><span class="hs-special">)</span><span>
</span><span id="line-288"></span><span>                  </span><span class="annot"><span class="annottext">NodeDef -&gt; (NodeDef -&gt; NodeDef) -&gt; NodeDef
forall s t. s -&gt; (s -&gt; t) -&gt; t
</span><span class="hs-operator hs-var">&amp;</span></span><span> </span><span class="annot"><span class="annottext">forall (f :: * -&gt; *).
Identical f =&gt;
LensLike' f NodeDef (Map Text AttrValue)
forall (f :: * -&gt; *) s a.
(Functor f, HasField s &quot;attr&quot; a) =&gt;
LensLike' f s a
</span><span class="hs-identifier hs-var">attr</span></span><span> </span><span class="annot"><span class="annottext">(forall (f :: * -&gt; *).
 Identical f =&gt;
 LensLike' f NodeDef (Map Text AttrValue))
-&gt; Map Text AttrValue -&gt; NodeDef -&gt; NodeDef
forall s t a b. Setter s t a b -&gt; b -&gt; s -&gt; t
</span><span class="hs-operator hs-var">.~</span></span><span> </span><span class="annot"><span class="annottext">OpDef -&gt; Map Text AttrValue
</span><a href="TensorFlow.Output.html#_opAttrs"><span class="hs-identifier hs-var hs-var">_opAttrs</span></a></span><span> </span><span class="annot"><span class="annottext">OpDef
</span><a href="#local-6989586621679165343"><span class="hs-identifier hs-var">o</span></a></span><span>
</span><span id="line-289"></span><span>                  </span><span class="annot"><span class="annottext">NodeDef -&gt; (NodeDef -&gt; NodeDef) -&gt; NodeDef
forall s t. s -&gt; (s -&gt; t) -&gt; t
</span><span class="hs-operator hs-var">&amp;</span></span><span> </span><span class="annot"><span class="annottext">forall (f :: * -&gt; *). Identical f =&gt; LensLike' f NodeDef [Text]
forall (f :: * -&gt; *) s a.
(Functor f, HasField s &quot;input&quot; a) =&gt;
LensLike' f s a
</span><span class="hs-identifier hs-var">input</span></span><span> </span><span class="annot"><span class="annottext">(forall (f :: * -&gt; *). Identical f =&gt; LensLike' f NodeDef [Text])
-&gt; [Text] -&gt; NodeDef -&gt; NodeDef
forall s t a b. Setter s t a b -&gt; b -&gt; s -&gt; t
</span><span class="hs-operator hs-var">.~</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679165336"><span class="hs-identifier hs-var">inputs</span></a></span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; [Text] -&gt; [Text]
forall a. [a] -&gt; [a] -&gt; [a]
</span><span class="hs-operator hs-var">++</span></span><span> </span><span class="annot"><span class="annottext">[Text]
</span><a href="#local-6989586621679165335"><span class="hs-identifier hs-var">controlInputs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-290"></span><span>                  </span><span class="annot"><span class="annottext">NodeDef -&gt; (NodeDef -&gt; NodeDef) -&gt; NodeDef
forall s t. s -&gt; (s -&gt; t) -&gt; t
</span><span class="hs-operator hs-var">&amp;</span></span><span> </span><span class="annot"><span class="annottext">forall (f :: * -&gt; *). Identical f =&gt; LensLike' f NodeDef Text
forall (f :: * -&gt; *) s a.
(Functor f, HasField s &quot;device&quot; a) =&gt;
LensLike' f s a
</span><span class="hs-identifier hs-var">device</span></span><span> </span><span class="annot"><span class="annottext">(forall (f :: * -&gt; *). Identical f =&gt; LensLike' f NodeDef Text)
-&gt; Text -&gt; NodeDef -&gt; NodeDef
forall s t a b. Setter s t a b -&gt; b -&gt; s -&gt; t
</span><span class="hs-operator hs-var">.~</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679165342"><span class="hs-identifier hs-var">dev</span></a></span><span>
</span><span id="line-291"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-292"></span><span>    </span><span id="local-6989586621679165334"><span class="annot"><span class="annottext">makeDep :: NodeName -&gt; Text
</span><a href="#local-6989586621679165334"><span class="hs-identifier hs-var hs-var">makeDep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-string">&quot;^&quot;</span></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><span class="hs-operator hs-var">&lt;&gt;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Text) -&gt; (NodeName -&gt; Text) -&gt; NodeName -&gt; Text
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><span class="hs-operator hs-var">.</span></span><span> </span><span class="annot"><span class="annottext">NodeName -&gt; Text
</span><a href="TensorFlow.Output.html#unNodeName"><span class="hs-identifier hs-var hs-var">unNodeName</span></a></span><span>
</span><span id="line-293"></span><span>
</span><span id="line-294"></span><span class="hs-comment">-- | Pick a name for a pending node.  If it has an explicit name, just use that;</span><span>
</span><span id="line-295"></span><span class="hs-comment">-- if the name is implicit, assign a new unique name based on the op type.</span><span>
</span><span id="line-296"></span><span class="annot"><a href="TensorFlow.Build.html#renderPendingNode"><span class="hs-identifier hs-type">renderPendingNode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#PendingNode"><span class="hs-identifier hs-type">PendingNode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#Build"><span class="hs-identifier hs-type">Build</span></a></span><span> </span><span class="annot"><a href="TensorFlow.Output.html#NodeName"><span class="hs-identifier hs-type">NodeName</span></a></span><span>
</span><span id="line-297"></span><span id="renderPendingNode"><span class="annot"><span class="annottext">renderPendingNode :: PendingNode -&gt; Build NodeName
</span><a href="TensorFlow.Build.html#renderPendingNode"><span class="hs-identifier hs-var hs-var">renderPendingNode</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Build.html#PendingNode"><span class="hs-identifier hs-type">PendingNode</span></a></span><span> </span><span id="local-6989586621679165331"><span class="annot"><span class="annottext">scope :: [Scope]
</span><a href="#local-6989586621679165331"><span class="hs-identifier hs-var">scope</span></a></span></span><span> </span><span id="local-6989586621679165330"><span class="annot"><span class="annottext">pendingName :: PendingNodeName
</span><a href="#local-6989586621679165330"><span class="hs-identifier hs-var">pendingName</span></a></span></span><span> </span><span id="local-6989586621679165329"><span class="annot"><span class="annottext">nodeDef :: NodeDef
</span><a href="#local-6989586621679165329"><span class="hs-identifier hs-var">nodeDef</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-298"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Text -&gt; NodeName
</span><a href="TensorFlow.Output.html#NodeName"><span class="hs-identifier hs-var">NodeName</span></a></span><span> </span><span class="annot"><span class="annottext">(Text -&gt; NodeName) -&gt; (Text -&gt; Text) -&gt; Text -&gt; NodeName
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><span class="hs-operator hs-var">.</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679165328"><span class="hs-identifier hs-var">scopePrefix</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><span class="hs-operator hs-var">&lt;&gt;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Text -&gt; NodeName) -&gt; BuildT Identity Text -&gt; Build NodeName
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><span class="hs-operator hs-var">&lt;$&gt;</span></span><span> </span><span class="annot"><span class="annottext">BuildT Identity Text
</span><a href="#local-6989586621679165327"><span class="hs-identifier hs-var">getName</span></a></span><span>
</span><span id="line-299"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-300"></span><span>    </span><span id="local-6989586621679165328"><span class="annot"><span class="annottext">scopePrefix :: Text
</span><a href="#local-6989586621679165328"><span class="hs-identifier hs-var hs-var">scopePrefix</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Text] -&gt; Text
</span><span class="hs-identifier hs-var">Text.concat</span></span><span> </span><span class="annot"><span class="annottext">([Text] -&gt; Text) -&gt; [Text] -&gt; Text
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">(Scope -&gt; Text) -&gt; [Scope] -&gt; [Text]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><span class="hs-identifier hs-var">fmap</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><span class="hs-operator hs-var">&lt;&gt;</span></span><span> </span><span class="annot"><span class="hs-string">&quot;/&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Text -&gt; Text) -&gt; (Scope -&gt; Text) -&gt; Scope -&gt; Text
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><span class="hs-operator hs-var">.</span></span><span> </span><span class="annot"><span class="annottext">Scope -&gt; Text
</span><a href="TensorFlow.Build.html#unScope"><span class="hs-identifier hs-var hs-var">unScope</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Scope]
</span><a href="#local-6989586621679165331"><span class="hs-identifier hs-var">scope</span></a></span><span>
</span><span id="line-301"></span><span>    </span><span id="local-6989586621679165327"><span class="annot"><span class="annottext">getName :: BuildT Identity Text
</span><a href="#local-6989586621679165327"><span class="hs-identifier hs-var hs-var">getName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">PendingNodeName
</span><a href="#local-6989586621679165330"><span class="hs-identifier hs-var">pendingName</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-302"></span><span>        </span><span class="annot"><a href="TensorFlow.Output.html#ExplicitName"><span class="hs-identifier hs-type">ExplicitName</span></a></span><span> </span><span id="local-6989586621679165325"><span class="annot"><span class="annottext">n :: Text
</span><a href="#local-6989586621679165325"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Text -&gt; BuildT Identity Text
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><span class="hs-identifier hs-var">return</span></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679165325"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-303"></span><span>        </span><span class="annot"><a href="TensorFlow.Output.html#ImplicitName"><span class="hs-identifier hs-type">ImplicitName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-304"></span><span>            </span><span id="local-6989586621679165324"><span class="annot"><span class="annottext">u :: Unique
</span><a href="#local-6989586621679165324"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Build.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span> </span><span id="local-6989586621679165323"><span class="annot"><span class="annottext">k :: Int
</span><a href="#local-6989586621679165323"><span class="hs-identifier hs-var">k</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FoldLike Unique GraphState GraphState Unique Unique
-&gt; BuildT Identity Unique
forall s (m :: * -&gt; *) a t b.
MonadState s m =&gt;
FoldLike a s t a b -&gt; m a
</span><span class="hs-identifier hs-var">use</span></span><span> </span><span class="annot"><span class="annottext">FoldLike Unique GraphState GraphState Unique Unique
Lens GraphState GraphState Unique Unique
</span><a href="TensorFlow.Build.html#nextUnique"><span class="hs-identifier hs-var">nextUnique</span></a></span><span>
</span><span id="line-305"></span><span>            </span><span class="annot"><span class="annottext">Lens GraphState GraphState Unique Unique
forall (f :: * -&gt; *). Identical f =&gt; LensLike' f GraphState Unique
</span><a href="TensorFlow.Build.html#nextUnique"><span class="hs-identifier hs-var">nextUnique</span></a></span><span> </span><span class="annot"><span class="annottext">(forall (f :: * -&gt; *).
 Identical f =&gt;
 LensLike' f GraphState Unique)
-&gt; Unique -&gt; BuildT Identity ()
forall s (m :: * -&gt; *) a b.
MonadState s m =&gt;
Setter s s a b -&gt; b -&gt; m ()
</span><span class="hs-operator hs-var">.=</span></span><span> </span><span class="annot"><span class="annottext">Unique -&gt; Unique
forall a. Enum a =&gt; a -&gt; a
</span><span class="hs-identifier hs-var">succ</span></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621679165324"><span class="hs-identifier hs-var">u</span></a></span><span>
</span><span id="line-306"></span><span>            </span><span class="annot"><span class="annottext">Text -&gt; BuildT Identity Text
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><span class="hs-identifier hs-var">return</span></span><span> </span><span class="annot"><span class="annottext">(Text -&gt; BuildT Identity Text) -&gt; Text -&gt; BuildT Identity Text
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">NodeDef
</span><a href="#local-6989586621679165329"><span class="hs-identifier hs-var">nodeDef</span></a></span><span> </span><span class="annot"><span class="annottext">NodeDef -&gt; FoldLike Text NodeDef NodeDef Text Text -&gt; Text
forall s a t b. s -&gt; FoldLike a s t a b -&gt; a
</span><span class="hs-operator hs-var">^.</span></span><span> </span><span class="annot"><span class="annottext">FoldLike Text NodeDef NodeDef Text Text
forall (f :: * -&gt; *) s a.
(Functor f, HasField s &quot;op&quot; a) =&gt;
LensLike' f s a
</span><span class="hs-identifier hs-var">op</span></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><span class="hs-operator hs-var">&lt;&gt;</span></span><span> </span><span class="annot"><span class="hs-string">&quot;_&quot;</span></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><span class="hs-operator hs-var">&lt;&gt;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; Text
</span><span class="hs-identifier hs-var">Text.pack</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><span class="hs-identifier hs-var">show</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679165323"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-307"></span><span>
</span><span id="line-308"></span><span class="hs-comment">-- | Turn an 'Output' into a string representation for the TensorFlow</span><span>
</span><span id="line-309"></span><span class="hs-comment">-- foreign APIs.</span><span>
</span><span id="line-310"></span><span class="annot"><a href="TensorFlow.Build.html#encodeOutput"><span class="hs-identifier hs-type">encodeOutput</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Output.html#Output"><span class="hs-identifier hs-type">Output</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Text</span></span><span>
</span><span id="line-311"></span><span id="encodeOutput"><span class="annot"><span class="annottext">encodeOutput :: Output -&gt; Text
</span><a href="TensorFlow.Build.html#encodeOutput"><span class="hs-identifier hs-var hs-var">encodeOutput</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Output.html#Output"><span class="hs-identifier hs-type">Output</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Output.html#OutputIx"><span class="hs-identifier hs-type">OutputIx</span></a></span><span> </span><span class="hs-number">0</span><span class="hs-special">)</span><span> </span><span id="local-6989586621679165318"><span class="annot"><span class="annottext">n :: NodeName
</span><a href="#local-6989586621679165318"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NodeName -&gt; Text
</span><a href="TensorFlow.Output.html#unNodeName"><span class="hs-identifier hs-var hs-var">unNodeName</span></a></span><span> </span><span class="annot"><span class="annottext">NodeName
</span><a href="#local-6989586621679165318"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-312"></span><span class="annot"><a href="TensorFlow.Build.html#encodeOutput"><span class="hs-identifier hs-var">encodeOutput</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Output.html#Output"><span class="hs-identifier hs-type">Output</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="TensorFlow.Output.html#OutputIx"><span class="hs-identifier hs-type">OutputIx</span></a></span><span> </span><span id="local-6989586621679165317"><span class="annot"><span class="annottext">i :: Int
</span><a href="#local-6989586621679165317"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679165316"><span class="annot"><span class="annottext">n :: NodeName
</span><a href="#local-6989586621679165316"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NodeName -&gt; Text
</span><a href="TensorFlow.Output.html#unNodeName"><span class="hs-identifier hs-var hs-var">unNodeName</span></a></span><span> </span><span class="annot"><span class="annottext">NodeName
</span><a href="#local-6989586621679165316"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Text -&gt; Text -&gt; Text
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><span class="hs-operator hs-var">&lt;&gt;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; Text
</span><span class="hs-identifier hs-var">Text.pack</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-char">':'</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; ShowS
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><span class="hs-identifier hs-var">show</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679165317"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-313"></span><span>
</span><span id="line-314"></span><span class="hs-comment">-- | Modify some part of the state, run an action, and restore the state</span><span>
</span><span id="line-315"></span><span class="hs-comment">-- after that action is done.</span><span>
</span><span id="line-316"></span><span id="local-6989586621679165646"><span id="local-6989586621679165647"><span id="local-6989586621679165648"><span class="annot"><a href="TensorFlow.Build.html#withStateLens"><span class="hs-identifier hs-type">withStateLens</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#MonadBuild"><span class="hs-identifier hs-type">MonadBuild</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165648"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Lens'</span></span><span> </span><span class="annot"><a href="TensorFlow.Build.html#GraphState"><span class="hs-identifier hs-type">GraphState</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165647"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679165647"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679165647"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679165648"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165646"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679165648"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165646"><span class="hs-identifier hs-type">b</span></a></span></span></span></span><span>
</span><span id="line-317"></span><span id="withStateLens"><span class="annot"><span class="annottext">withStateLens :: Lens' GraphState a -&gt; (a -&gt; a) -&gt; m b -&gt; m b
</span><a href="TensorFlow.Build.html#withStateLens"><span class="hs-identifier hs-var hs-var">withStateLens</span></a></span></span><span> </span><span id="local-6989586621679165315"><span class="annot"><span class="annottext">accessor :: Lens' GraphState a
</span><a href="#local-6989586621679165315"><span class="hs-identifier hs-var">accessor</span></a></span></span><span> </span><span id="local-6989586621679165314"><span class="annot"><span class="annottext">f :: a -&gt; a
</span><a href="#local-6989586621679165314"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679165313"><span class="annot"><span class="annottext">act :: m b
</span><a href="#local-6989586621679165313"><span class="hs-identifier hs-var">act</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-318"></span><span>    </span><span id="local-6989586621679165312"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679165312"><span class="hs-identifier hs-var">old</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Build a -&gt; m a
forall (m :: * -&gt; *) a. MonadBuild m =&gt; Build a -&gt; m a
</span><a href="TensorFlow.Build.html#build"><span class="hs-identifier hs-var">build</span></a></span><span> </span><span class="annot"><span class="annottext">(Build a -&gt; m a) -&gt; Build a -&gt; m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">FoldLike a GraphState GraphState a a -&gt; Build a
forall s (m :: * -&gt; *) a t b.
MonadState s m =&gt;
FoldLike a s t a b -&gt; m a
</span><span class="hs-identifier hs-var">use</span></span><span> </span><span class="annot"><span class="annottext">FoldLike a GraphState GraphState a a
Lens' GraphState a
</span><a href="#local-6989586621679165315"><span class="hs-identifier hs-var">accessor</span></a></span><span>
</span><span id="line-319"></span><span>    </span><span class="annot"><span class="annottext">BuildT Identity () -&gt; m ()
forall (m :: * -&gt; *) a. MonadBuild m =&gt; Build a -&gt; m a
</span><a href="TensorFlow.Build.html#build"><span class="hs-identifier hs-var">build</span></a></span><span> </span><span class="annot"><span class="annottext">(BuildT Identity () -&gt; m ()) -&gt; BuildT Identity () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">Lens' GraphState a
forall (f :: * -&gt; *). Identical f =&gt; LensLike' f GraphState a
</span><a href="#local-6989586621679165315"><span class="hs-identifier hs-var">accessor</span></a></span><span> </span><span class="annot"><span class="annottext">(forall (f :: * -&gt; *). Identical f =&gt; LensLike' f GraphState a)
-&gt; (a -&gt; a) -&gt; BuildT Identity ()
forall s (m :: * -&gt; *) a b.
MonadState s m =&gt;
Setter s s a b -&gt; (a -&gt; b) -&gt; m ()
</span><span class="hs-operator hs-var">%=</span></span><span> </span><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621679165314"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-320"></span><span>    </span><span id="local-6989586621679165311"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679165311"><span class="hs-identifier hs-var">result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m b
</span><a href="#local-6989586621679165313"><span class="hs-identifier hs-var">act</span></a></span><span>
</span><span id="line-321"></span><span>    </span><span class="annot"><span class="annottext">BuildT Identity () -&gt; m ()
forall (m :: * -&gt; *) a. MonadBuild m =&gt; Build a -&gt; m a
</span><a href="TensorFlow.Build.html#build"><span class="hs-identifier hs-var">build</span></a></span><span> </span><span class="annot"><span class="annottext">(BuildT Identity () -&gt; m ()) -&gt; BuildT Identity () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><span class="hs-operator hs-var">$</span></span><span> </span><span class="annot"><span class="annottext">Lens' GraphState a
forall (f :: * -&gt; *). Identical f =&gt; LensLike' f GraphState a
</span><a href="#local-6989586621679165315"><span class="hs-identifier hs-var">accessor</span></a></span><span> </span><span class="annot"><span class="annottext">(forall (f :: * -&gt; *). Identical f =&gt; LensLike' f GraphState a)
-&gt; a -&gt; BuildT Identity ()
forall s (m :: * -&gt; *) a b.
MonadState s m =&gt;
Setter s s a b -&gt; b -&gt; m ()
</span><span class="hs-operator hs-var">.=</span></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679165312"><span class="hs-identifier hs-var">old</span></a></span><span>
</span><span id="line-322"></span><span>    </span><span class="annot"><span class="annottext">b -&gt; m b
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><span class="hs-identifier hs-var">return</span></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679165311"><span class="hs-identifier hs-var">result</span></a></span><span>
</span><span id="line-323"></span><span>
</span><span id="line-324"></span><span class="hs-comment">-- | Set a device for all nodes rendered in the given 'Build' action</span><span>
</span><span id="line-325"></span><span class="hs-comment">-- (unless further overridden by another use of withDevice).</span><span>
</span><span id="line-326"></span><span id="local-6989586621679165309"><span id="local-6989586621679165310"><span class="annot"><a href="TensorFlow.Build.html#withDevice"><span class="hs-identifier hs-type">withDevice</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#MonadBuild"><span class="hs-identifier hs-type">MonadBuild</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165310"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Maybe</span></span><span> </span><span class="annot"><a href="TensorFlow.Output.html#Device"><span class="hs-identifier hs-type">Device</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679165310"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165309"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679165310"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165309"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-327"></span><span id="withDevice"><span class="annot"><span class="annottext">withDevice :: Maybe Device -&gt; m a -&gt; m a
</span><a href="TensorFlow.Build.html#withDevice"><span class="hs-identifier hs-var hs-var">withDevice</span></a></span></span><span> </span><span id="local-6989586621679165308"><span class="annot"><span class="annottext">d :: Maybe Device
</span><a href="#local-6989586621679165308"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Lens GraphState GraphState (Maybe Device) (Maybe Device)
-&gt; (Maybe Device -&gt; Maybe Device) -&gt; m a -&gt; m a
forall (m :: * -&gt; *) a b.
MonadBuild m =&gt;
Lens' GraphState a -&gt; (a -&gt; a) -&gt; m b -&gt; m b
</span><a href="TensorFlow.Build.html#withStateLens"><span class="hs-identifier hs-var">withStateLens</span></a></span><span> </span><span class="annot"><span class="annottext">Lens GraphState GraphState (Maybe Device) (Maybe Device)
</span><a href="TensorFlow.Build.html#defaultDevice"><span class="hs-identifier hs-var">defaultDevice</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Device -&gt; Maybe Device -&gt; Maybe Device
forall a b. a -&gt; b -&gt; a
</span><span class="hs-identifier hs-var">const</span></span><span> </span><span class="annot"><span class="annottext">Maybe Device
</span><a href="#local-6989586621679165308"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-328"></span><span>
</span><span id="line-329"></span><span class="hs-comment">-- | Prepend a scope to all nodes rendered in the given 'Build' action.</span><span>
</span><span id="line-330"></span><span id="local-6989586621679165305"><span id="local-6989586621679165306"><span class="annot"><a href="TensorFlow.Build.html#withNameScope"><span class="hs-identifier hs-type">withNameScope</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#MonadBuild"><span class="hs-identifier hs-type">MonadBuild</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165306"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Text</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679165306"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165305"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679165306"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165305"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-331"></span><span id="withNameScope"><span class="annot"><span class="annottext">withNameScope :: Text -&gt; m a -&gt; m a
</span><a href="TensorFlow.Build.html#withNameScope"><span class="hs-identifier hs-var hs-var">withNameScope</span></a></span></span><span> </span><span id="local-6989586621679165304"><span class="annot"><span class="annottext">s :: Text
</span><a href="#local-6989586621679165304"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Lens GraphState GraphState [Scope] [Scope]
-&gt; ([Scope] -&gt; [Scope]) -&gt; m a -&gt; m a
forall (m :: * -&gt; *) a b.
MonadBuild m =&gt;
Lens' GraphState a -&gt; (a -&gt; a) -&gt; m b -&gt; m b
</span><a href="TensorFlow.Build.html#withStateLens"><span class="hs-identifier hs-var">withStateLens</span></a></span><span> </span><span class="annot"><span class="annottext">Lens GraphState GraphState [Scope] [Scope]
</span><a href="TensorFlow.Build.html#currentScope"><span class="hs-identifier hs-var">currentScope</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Text -&gt; Scope
</span><a href="TensorFlow.Build.html#Scope"><span class="hs-identifier hs-var">Scope</span></a></span><span> </span><span class="annot"><span class="annottext">Text
</span><a href="#local-6989586621679165304"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Scope -&gt; [Scope] -&gt; [Scope]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="hs-special">)</span><span>
</span><span id="line-332"></span><span>
</span><span id="line-333"></span><span class="hs-comment">-- | Add control inputs to all nodes rendered in the given 'Build' action.</span><span>
</span><span id="line-334"></span><span id="local-6989586621679165302"><span id="local-6989586621679165303"><span class="annot"><a href="TensorFlow.Build.html#withNodeDependencies"><span class="hs-identifier hs-type">withNodeDependencies</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="TensorFlow.Build.html#MonadBuild"><span class="hs-identifier hs-type">MonadBuild</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165303"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Set</span></span><span> </span><span class="annot"><a href="TensorFlow.Output.html#NodeName"><span class="hs-identifier hs-type">NodeName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679165303"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165302"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679165303"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679165302"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-335"></span><span id="withNodeDependencies"><span class="annot"><span class="annottext">withNodeDependencies :: Set NodeName -&gt; m a -&gt; m a
</span><a href="TensorFlow.Build.html#withNodeDependencies"><span class="hs-identifier hs-var hs-var">withNodeDependencies</span></a></span></span><span> </span><span id="local-6989586621679165301"><span class="annot"><span class="annottext">nodes :: Set NodeName
</span><a href="#local-6989586621679165301"><span class="hs-identifier hs-var">nodes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Lens GraphState GraphState (Set NodeName) (Set NodeName)
-&gt; (Set NodeName -&gt; Set NodeName) -&gt; m a -&gt; m a
forall (m :: * -&gt; *) a b.
MonadBuild m =&gt;
Lens' GraphState a -&gt; (a -&gt; a) -&gt; m b -&gt; m b
</span><a href="TensorFlow.Build.html#withStateLens"><span class="hs-identifier hs-var">withStateLens</span></a></span><span> </span><span class="annot"><span class="annottext">Lens GraphState GraphState (Set NodeName) (Set NodeName)
</span><a href="TensorFlow.Build.html#defaultControlInputs"><span class="hs-identifier hs-var">defaultControlInputs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Set NodeName -&gt; Set NodeName -&gt; Set NodeName
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><span class="hs-operator hs-var">&lt;&gt;</span></span><span> </span><span class="annot"><span class="annottext">Set NodeName
</span><a href="#local-6989586621679165301"><span class="hs-identifier hs-var">nodes</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-336"></span></pre></body></html>